summaryrefslogtreecommitdiff
path: root/src/modules/sysinfo/thermal
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-08-23 21:52:10 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-10-11 16:25:10 +0100
commite4339f481999657d745c9a4a66c734445cbeaf3c (patch)
treec54d1d77c1bbaae6aa6f86fe7db4eeda268a07d4 /src/modules/sysinfo/thermal
parenta9b303baa5762095c5b371da2d635cdc6c4fb91b (diff)
downloadenlightenment-e4339f481999657d745c9a4a66c734445cbeaf3c.tar.gz
bryce - improve usability from code and user by having std right menu
now right click on any gagdte in bryce and they ALL have a menu that allows removal of the gagdte bar or the gadget as well as access to gadget settings AND the ability for gadgets to extendthis menu like lunhcer does per icon. now it's standard behavior everywhere which is much easier to use and discover. it also removes code from every gadget to do their own "button 3" handling as its handled centrally making the code in gadgets simpler. this is part of my effort to improve usability (mostly discoverability and accessibility of settings/features). also long press left mouse gets u gadget right click menu this has to move many modules/gadgets actions to mouse up instead of mouse down so the bryce has a chance to trap the events first and set hold flags. but now long press for 0.5 sec and bryce menu come sup (with left mouse .. so touch friendly). in addition move context menu hanbdling to e_gadget instead of in bryce and in e_gadget. a context callback is called so different systems can still do different things. this should probably change to always pop up a mnenu and simple call populate callbacks for site owner specific content. all in all it makes the new gagdtes more consistent, easier to use (without a right mouse button), doesn't need special action bindings etc. etc.
Diffstat (limited to 'src/modules/sysinfo/thermal')
-rw-r--r--src/modules/sysinfo/thermal/thermal.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/modules/sysinfo/thermal/thermal.c b/src/modules/sysinfo/thermal/thermal.c
index c1441aee0d..c384542cfa 100644
--- a/src/modules/sysinfo/thermal/thermal.c
+++ b/src/modules/sysinfo/thermal/thermal.c
@@ -231,30 +231,19 @@ _thermal_popup_create(Instance *inst)
}
static void
-_thermal_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data)
+_thermal_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data)
{
- Evas_Event_Mouse_Down *ev = event_data;
+ Evas_Event_Mouse_Up *ev = event_data;
Instance *inst = data;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- if (ev->button != 3)
+ if (ev->button == 1)
{
if (inst->cfg->thermal.popup)
elm_ctxpopup_dismiss(inst->cfg->thermal.popup);
else
inst->cfg->thermal.popup = _thermal_popup_create(inst);
}
- else
- {
- if (inst->cfg->thermal.popup)
- elm_ctxpopup_dismiss(inst->cfg->thermal.popup);
- if (!sysinfo_config) return;
- ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- if (inst->cfg->esm != E_SYSINFO_MODULE_THERMAL)
- thermal_configure(inst);
- else
- e_gadget_configure(inst->o_main);
- }
}
static Eina_Bool
@@ -426,8 +415,8 @@ _thermal_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
E_FILL(inst->cfg->thermal.o_gadget);
elm_box_pack_end(inst->o_main, inst->cfg->thermal.o_gadget);
evas_object_event_callback_add(inst->cfg->thermal.o_gadget,
- EVAS_CALLBACK_MOUSE_DOWN,
- _thermal_mouse_down_cb, inst);
+ EVAS_CALLBACK_MOUSE_UP,
+ _thermal_mouse_up_cb, inst);
evas_object_event_callback_add(inst->cfg->thermal.o_gadget, EVAS_CALLBACK_RESIZE, _thermal_resize_cb, inst);
evas_object_show(inst->cfg->thermal.o_gadget);
evas_object_smart_callback_del_full(obj, "gadget_created", _thermal_created_cb, data);
@@ -451,8 +440,8 @@ sysinfo_thermal_create(Evas_Object *parent, Instance *inst)
E_EXPAND(inst->cfg->thermal.o_gadget);
E_FILL(inst->cfg->thermal.o_gadget);
evas_object_event_callback_add(inst->cfg->thermal.o_gadget,
- EVAS_CALLBACK_MOUSE_DOWN,
- _thermal_mouse_down_cb, inst);
+ EVAS_CALLBACK_MOUSE_UP,
+ _thermal_mouse_up_cb, inst);
evas_object_event_callback_add(inst->cfg->thermal.o_gadget, EVAS_CALLBACK_RESIZE, _thermal_resize_cb, inst);
evas_object_show(inst->cfg->thermal.o_gadget);