okra pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=73495d63476e396a86c640b845c5006c700cac87
commit 73495d63476e396a86c640b845c5006c700cac87 Author: Stephen 'Okra' Houston <[email protected]> Date: Fri Feb 10 11:59:47 2017 -0600 Sysinfo Gadgets: Allow for vertical themes for all sysinfo gadgets This is in preparation for themers in the future. --- src/modules/sysinfo/batman/batman.c | 10 ++++++++-- src/modules/sysinfo/cpuclock/cpuclock.c | 10 ++++++++-- src/modules/sysinfo/netstatus/netstatus.c | 10 ++++++++-- src/modules/sysinfo/thermal/thermal.c | 10 ++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/modules/sysinfo/batman/batman.c b/src/modules/sysinfo/batman/batman.c index fcb7fdc..2d9e095 100644 --- a/src/modules/sysinfo/batman/batman.c +++ b/src/modules/sysinfo/batman/batman.c @@ -578,6 +578,7 @@ static void _batman_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED) { Instance *inst = data; + E_Gadget_Site_Orient orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main)); e_gadget_configure_cb_set(inst->o_main, _batman_configure_cb); @@ -587,8 +588,13 @@ _batman_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED) inst->cfg->batman.have_power = -2; inst->cfg->batman.o_gadget = elm_layout_add(inst->o_main); - e_theme_edje_object_set(inst->cfg->batman.o_gadget, "base/theme/modules/batman", - "e/modules/batman/main"); + if (orient == E_GADGET_SITE_ORIENT_VERTICAL) + e_theme_edje_object_set(inst->cfg->batman.o_gadget, + "base/theme/modules/batman", + "e/modules/batman/main_vert"); + else + e_theme_edje_object_set(inst->cfg->batman.o_gadget, "base/theme/modules/batman", + "e/modules/batman/main"); E_EXPAND(inst->cfg->batman.o_gadget); E_FILL(inst->cfg->batman.o_gadget); elm_box_pack_end(inst->o_main, inst->cfg->batman.o_gadget); diff --git a/src/modules/sysinfo/cpuclock/cpuclock.c b/src/modules/sysinfo/cpuclock/cpuclock.c index 2ef6a39..5edbfbf 100644 --- a/src/modules/sysinfo/cpuclock/cpuclock.c +++ b/src/modules/sysinfo/cpuclock/cpuclock.c @@ -832,13 +832,19 @@ static void _cpuclock_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED) { Instance *inst = data; + E_Gadget_Site_Orient orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main)); if (inst->cfg->cpuclock.pstate_min == 0) inst->cfg->cpuclock.pstate_min = 1; if (inst->cfg->cpuclock.pstate_max == 0) inst->cfg->cpuclock.pstate_max = 101; inst->cfg->cpuclock.o_gadget = elm_layout_add(inst->o_main); - e_theme_edje_object_set(inst->cfg->cpuclock.o_gadget, "base/theme/modules/cpufreq", - "e/modules/cpufreq/main"); + if (orient == E_GADGET_SITE_ORIENT_VERTICAL) + e_theme_edje_object_set(inst->cfg->cpuclock.o_gadget, + "base/theme/modules/cpuclock", + "e/modules/cpuclock/main_vert"); + else + e_theme_edje_object_set(inst->cfg->cpuclock.o_gadget, "base/theme/modules/cpuclock", + "e/modules/cpuclock/main"); E_EXPAND(inst->cfg->cpuclock.o_gadget); E_FILL(inst->cfg->cpuclock.o_gadget); edje_object_signal_callback_add(elm_layout_edje_get(inst->cfg->cpuclock.o_gadget), "e,action,governor,next", "*", diff --git a/src/modules/sysinfo/netstatus/netstatus.c b/src/modules/sysinfo/netstatus/netstatus.c index 078b6b8..b5ebf83 100644 --- a/src/modules/sysinfo/netstatus/netstatus.c +++ b/src/modules/sysinfo/netstatus/netstatus.c @@ -227,12 +227,18 @@ static void _netstatus_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED) { Instance *inst = data; + E_Gadget_Site_Orient orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main)); e_gadget_configure_cb_set(inst->o_main, _netstatus_configure_cb); inst->cfg->netstatus.o_gadget = elm_layout_add(inst->o_main); - e_theme_edje_object_set(inst->cfg->netstatus.o_gadget, "base/theme/modules/netstatus", - "e/modules/netstatus/main"); + if (orient == E_GADGET_SITE_ORIENT_VERTICAL) + e_theme_edje_object_set(inst->cfg->netstatus.o_gadget, + "base/theme/modules/netstatus", + "e/modules/netstatus/main_vert"); + else + e_theme_edje_object_set(inst->cfg->netstatus.o_gadget, "base/theme/modules/netstatus", + "e/modules/netstatus/main"); E_EXPAND(inst->cfg->netstatus.o_gadget); E_FILL(inst->cfg->netstatus.o_gadget); elm_box_pack_end(inst->o_main, inst->cfg->netstatus.o_gadget); diff --git a/src/modules/sysinfo/thermal/thermal.c b/src/modules/sysinfo/thermal/thermal.c index 53135d7..e3e0d6b 100644 --- a/src/modules/sysinfo/thermal/thermal.c +++ b/src/modules/sysinfo/thermal/thermal.c @@ -231,13 +231,19 @@ static void _thermal_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED) { Instance *inst = data; + E_Gadget_Site_Orient orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main)); inst->cfg->thermal.temp = 900; inst->cfg->thermal.have_temp = EINA_FALSE; inst->cfg->thermal.o_gadget = elm_layout_add(inst->o_main); - e_theme_edje_object_set(inst->cfg->thermal.o_gadget, "base/theme/modules/temperature", - "e/modules/temperature/main"); + if (orient == E_GADGET_SITE_ORIENT_VERTICAL) + e_theme_edje_object_set(inst->cfg->thermal.o_gadget, + "base/theme/modules/thermal", + "e/modules/thermal/main_vert"); + else + e_theme_edje_object_set(inst->cfg->thermal.o_gadget, "base/theme/modules/thermal", + "e/modules/thermal/main"); 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); --
