From a9b303baa5762095c5b371da2d635cdc6c4fb91b Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 22 Aug 2018 17:22:50 +0900 Subject: [PATCH] bryce/gadgets - pass orientation to the style wrapper around the gadget bryce was missing the ability to espose orientation to the child items, so they were the same irrespective of orientation. i also notice that orientaiont is a simple horiz/vert ... so no ability to special case corners etc. in the theme... :( not sure if this should be changed. also fix the aspect calculation to round up correctly to avoid off-by-1 pixel gaps i noticed with the pager - necessary for the styling in the flat theme to be right. --- src/bin/e_bryce.c | 7 ++++++- src/bin/e_gadget.c | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/bin/e_bryce.c b/src/bin/e_bryce.c index 6dc0c97f9..68ef42089 100644 --- a/src/bin/e_bryce.c +++ b/src/bin/e_bryce.c @@ -368,7 +368,7 @@ _bryce_style(Evas_Object *site, Eina_Stringshare *name, Evas_Object *g) char buf[1024]; BRYCE_GET(site); - + ly = elm_layout_add(b->site); snprintf(buf, sizeof(buf), "e/bryce/%s/%s", b->style ?: "default", name ?: "plain"); if (!e_theme_edje_object_set(ly, NULL, buf)) @@ -376,6 +376,11 @@ _bryce_style(Evas_Object *site, Eina_Stringshare *name, Evas_Object *g) evas_object_del(ly); return; } + if (b->orient == E_GADGET_SITE_ORIENT_HORIZONTAL) + elm_layout_signal_emit(ly, "e,state,orient,horizontal", "e"); + else + elm_layout_signal_emit(ly, "e,state,orient,vertical", "e"); + edje_object_message_signal_process(elm_layout_edje_get(ly)); prev = e_gadget_util_layout_style_init(g, ly); elm_object_part_content_set(ly, "e.swallow.content", g); evas_object_smart_callback_call(g, "gadget_reparent", ly); diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c index 0d6f21569..f41370f67 100644 --- a/src/bin/e_gadget.c +++ b/src/bin/e_gadget.c @@ -578,16 +578,16 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax switch (aspect) { case EVAS_ASPECT_CONTROL_HORIZONTAL: - *hh = (*ww * (double)ay / ax); + *hh = (*ww * (double)ay / ax) + 0.99999999; break; case EVAS_ASPECT_CONTROL_VERTICAL: - *ww = (*hh * (double)ax / ay); + *ww = (*hh * (double)ax / ay) + 0.99999999; break; default: if (IS_HORIZ(zgc->site->orient)) - *ww = (*hh * (double)ax / ay); + *ww = (*hh * (double)ax / ay) + 0.99999999; else if (IS_VERT(zgc->site->orient)) - *hh = (*ww * (double)ay / ax); + *hh = (*ww * (double)ay / ax) + 0.99999999; else if (aspect) { double ar = ax / (double) ay; @@ -600,9 +600,9 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax *ww = *hh; } else if (ar > 1.0) - *hh = (*ww * (double)ay / ax); + *hh = (*ww * (double)ay / ax) + 0.99999999; else - *ww = (*hh * (double)ax / ay); + *ww = (*hh * (double)ax / ay) + 0.99999999; } } }