summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2017-01-09 21:01:28 +0100
committerDave Andreoli <dave@gurumeditation.it>2017-01-09 21:01:54 +0100
commit409230ee35292095020c1e5ef5cfa6e8a5e70f5b (patch)
tree4730f876576c3a8f5194d6ff588b738b08abd49a /src
parent483a978e83bbde1c87bbba15c01c5021035f34fd (diff)
downloadenlightenment-409230ee35292095020c1e5ef5cfa6e8a5e70f5b.tar.gz
cpu + mem gadget: use new vertical layouts
Diffstat (limited to 'src')
-rw-r--r--src/modules/sysinfo/cpumonitor/cpumonitor.c20
-rw-r--r--src/modules/sysinfo/memusage/memusage.c19
2 files changed, 25 insertions, 14 deletions
diff --git a/src/modules/sysinfo/cpumonitor/cpumonitor.c b/src/modules/sysinfo/cpumonitor/cpumonitor.c
index a86ea2caf2..c9bc37966c 100644
--- a/src/modules/sysinfo/cpumonitor/cpumonitor.c
+++ b/src/modules/sysinfo/cpumonitor/cpumonitor.c
@@ -61,10 +61,15 @@ Evas_Object *
_cpumonitor_add_layout(Instance *inst)
{
Evas_Object *layout;
+ int orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main));
layout = elm_layout_add(inst->cfg->cpumonitor.o_gadget);
- e_theme_edje_object_set(layout, "base/theme/modules/cpumonitor",
- "e/modules/cpumonitor/main");
+ if (orient == E_GADGET_SITE_ORIENT_VERTICAL)
+ e_theme_edje_object_set(layout, "base/theme/modules/cpumonitor",
+ "e/modules/cpumonitor/main_vert");
+ else
+ e_theme_edje_object_set(layout, "base/theme/modules/cpumonitor",
+ "e/modules/cpumonitor/main");
E_EXPAND(layout);
E_FILL(layout);
elm_box_pack_end(inst->cfg->cpumonitor.o_gadget, layout);
@@ -174,6 +179,7 @@ _cpumonitor_eval_instance_aspect(Instance *inst)
switch (e_gadget_site_orient_get(owner))
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
+ case E_GADGET_SITE_ORIENT_NONE:
evas_object_geometry_get(owner, NULL, NULL, NULL, &sh);
break;
@@ -181,10 +187,6 @@ _cpumonitor_eval_instance_aspect(Instance *inst)
evas_object_geometry_get(owner, NULL, NULL, &sw, NULL);
break;
- case E_GADGET_SITE_ORIENT_NONE:
- evas_object_geometry_get(owner, NULL, NULL, NULL, &sh);
- break;
-
default:
sw = sh = 48;
break;
@@ -205,9 +207,13 @@ static void
_cpumonitor_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
{
Instance *inst = data;
+ int orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main));
inst->cfg->cpumonitor.o_gadget = elm_box_add(inst->o_main);
- elm_box_horizontal_set(inst->cfg->cpumonitor.o_gadget, EINA_TRUE);
+ if (orient == E_GADGET_SITE_ORIENT_VERTICAL)
+ elm_box_horizontal_set(inst->cfg->cpumonitor.o_gadget, EINA_FALSE);
+ else
+ elm_box_horizontal_set(inst->cfg->cpumonitor.o_gadget, EINA_TRUE);
E_EXPAND(inst->cfg->cpumonitor.o_gadget);
E_FILL(inst->cfg->cpumonitor.o_gadget);
elm_box_pack_end(inst->o_main, inst->cfg->cpumonitor.o_gadget);
diff --git a/src/modules/sysinfo/memusage/memusage.c b/src/modules/sysinfo/memusage/memusage.c
index 5a5387c9e6..9c2da2e386 100644
--- a/src/modules/sysinfo/memusage/memusage.c
+++ b/src/modules/sysinfo/memusage/memusage.c
@@ -120,9 +120,11 @@ _memusage_eval_instance_aspect(Instance *inst)
owner = e_gadget_site_get(inst->o_main);
if (!owner)
return;
+
switch (e_gadget_site_orient_get(owner))
{
case E_GADGET_SITE_ORIENT_HORIZONTAL:
+ case E_GADGET_SITE_ORIENT_NONE:
evas_object_geometry_get(owner, NULL, NULL, NULL, &sh);
sw = sh;
break;
@@ -132,11 +134,6 @@ _memusage_eval_instance_aspect(Instance *inst)
sh = sw;
break;
- case E_GADGET_SITE_ORIENT_NONE:
- evas_object_geometry_get(owner, NULL, NULL, NULL, &sh);
- sw = sh;
- break;
-
default:
sw = sh = 48;
break;
@@ -152,10 +149,18 @@ static void
_memusage_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
{
Instance *inst = data;
+ int orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main));
inst->cfg->memusage.o_gadget = elm_layout_add(inst->o_main);
- e_theme_edje_object_set(inst->cfg->memusage.o_gadget, "base/theme/modules/memusage",
- "e/modules/memusage/main");
+ if (orient == E_GADGET_SITE_ORIENT_VERTICAL)
+ e_theme_edje_object_set(inst->cfg->memusage.o_gadget,
+ "base/theme/modules/memusage",
+ "e/modules/memusage/main_vert");
+ else
+ e_theme_edje_object_set(inst->cfg->memusage.o_gadget,
+ "base/theme/modules/memusage",
+ "e/modules/memusage/main");
+
E_EXPAND(inst->cfg->memusage.o_gadget);
E_FILL(inst->cfg->memusage.o_gadget);
elm_box_pack_end(inst->o_main, inst->cfg->memusage.o_gadget);