summaryrefslogtreecommitdiff
path: root/src/modules/sysinfo/thermal
diff options
context:
space:
mode:
authorStephen 'Okra' Houston <smhouston88@gmail.com>2017-01-27 13:48:02 -0600
committerStephen 'Okra' Houston <smhouston88@gmail.com>2017-01-27 13:49:04 -0600
commit1547ac080cc4d56b89279dd61418139e34fffb0d (patch)
treed956f209091aa03fa74e1c88780bf837c93bc574 /src/modules/sysinfo/thermal
parent1861f474e4c783fee9f9a3d50764891a67bfc3a5 (diff)
downloadenlightenment-1547ac080cc4d56b89279dd61418139e34fffb0d.tar.gz
Enlightenment: Sysinfo Gadget - Base size on edje extends calcs.
Diffstat (limited to 'src/modules/sysinfo/thermal')
-rw-r--r--src/modules/sysinfo/thermal/thermal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/sysinfo/thermal/thermal.c b/src/modules/sysinfo/thermal/thermal.c
index c9ed6554a8..f5749eddf6 100644
--- a/src/modules/sysinfo/thermal/thermal.c
+++ b/src/modules/sysinfo/thermal/thermal.c
@@ -183,6 +183,16 @@ _thermal_face_shutdown(Instance *inst)
}
static void
+_thermal_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_data EINA_UNUSED)
+{
+ Evas_Coord w, h;
+ Instance *inst = data;
+
+ edje_object_parts_extends_calc(elm_layout_edje_get(inst->cfg->thermal.o_gadget), 0, 0, &w, &h);
+ evas_object_size_hint_aspect_set(inst->o_main, EVAS_ASPECT_CONTROL_BOTH, w, h);
+}
+
+static void
_thermal_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
{
Instance *inst = data;
@@ -227,6 +237,7 @@ _thermal_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
E_EXPAND(inst->cfg->thermal.o_gadget);
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_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);
_thermal_config_updated(inst);