discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=3b1242e3140623fd01843edf39b7d3e6a7a60b89

commit 3b1242e3140623fd01843edf39b7d3e6a7a60b89
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Dec 6 10:49:31 2016 -0500

    revert all sizing commits to ibar/ibox for the past year
    
    the assumption that this code was making assumptions about elm_box
    internals based on a shallow reading of the code was incorrect, and
    the resulting "fix" (and subsequent attempts to bandaid it) has left these
    gadgets in an unusable state for the past half year.
    
    disappoint.jpg
    
    this reverts the following commits:
    
    f97f8f61aca18e3be3f170e0a205ad728ba269e5
    ebfa4a97cd6d9e801c9dd2dc0d169f4bd8a0bbc5
    50030dc69346c209109c36bb41631b176c85b2c5
    42aa6be35931e51b8dab5ed6629c3054595c82a8
    504706d45ac2858be91721bd398d0c36a9bffd2d
    b1f608c5e607c2101862eb4a63d53bef9cc58761
    b107dc1cdc18b5edcdb44e74e0c69f0bb0e65cb7
    3fc195cd9f926df1c92d906992d4e4c4ec5f3fe9
---
 src/modules/ibar/e_mod_main.c | 59 ++++++++++++++++++-------------------------
 src/modules/ibox/e_mod_main.c | 10 ++++----
 2 files changed, 30 insertions(+), 39 deletions(-)

diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index c4f01b5..8171090 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -285,7 +285,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, 
const char *style)
                         drop, 3, x, y, w, h);
    evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_MOVE,
                                   _ibar_cb_obj_moveresize, inst);
-   evas_object_event_callback_add(b->o_outerbox, 
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+   evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_RESIZE,
                                   _ibar_cb_obj_moveresize, inst);
    ibar_config->instances = eina_list_append(ibar_config->instances, inst);
    _ibar_resize_handle(b);
@@ -526,7 +526,7 @@ _ibar_empty_handle(IBar *b)
              evas_object_color_set(b->o_empty, 0, 0, 0, 0);
              evas_object_show(b->o_empty);
              elm_box_pack_end(b->o_box, b->o_empty);
-             evas_object_size_hint_min_get(b->o_box, &w, &h);
+             evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
              if (elm_box_horizontal_get(b->o_box))
                w = h;
              else
@@ -638,50 +638,41 @@ static void
 _ibar_resize_handle(IBar *b)
 {
    IBar_Icon *ic;
-   Evas_Coord w, h, ww = 0, hh = 0;
+   Evas_Coord w, h;
 
    if (!b->inst->gcc) return;
-
-   if (b->inst->gcc->gadcon->shelf)
-     {
-        /* we are in a shelf */
-        ww = hh = b->inst->gcc->gadcon->shelf->cfg->size * 
elm_config_scale_get();
-     }
-   else if (b->inst->gcc->max.w || b->inst->gcc->max.h)
-     {
-        evas_object_geometry_get(b->o_outerbox, NULL, NULL, &ww, &hh);
-        ww = MIN(b->inst->gcc->max.w, ww);
-        hh = MIN(b->inst->gcc->max.h, hh);
-     }
-
-   /* Fallback to a size for the case noone gives a max size and no shelf 
config is there */
-   if (ww == 0) ww = 40;
-   if (hh == 0) hh = 40;
-
-
-   if (elm_box_horizontal_get(b->o_box)) ww = hh;
-   else hh = ww;
+   elm_box_recalculate(b->o_box);
+   elm_box_recalculate(b->o_outerbox);
+   if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site))
+     evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
+   else
+     evas_object_geometry_get(b->o_outerbox, NULL, NULL, &w, &h);
+   if (b->inst->gcc->max.w)
+     w = MIN(w, b->inst->gcc->max.w);
+   if (b->inst->gcc->max.h)
+     h = MIN(h, b->inst->gcc->max.h);
+   if (elm_box_horizontal_get(b->o_box))
+     w = h;
+   else
+     h = w;
    EINA_INLIST_FOREACH(b->icons, ic)
      {
-        evas_object_size_hint_min_set(ic->o_holder, ww, hh);
-        evas_object_size_hint_max_set(ic->o_holder, ww, hh);
+        evas_object_size_hint_min_set(ic->o_holder, w, h);
+        evas_object_size_hint_max_set(ic->o_holder, w, h);
      }
    if (b->o_sep)
      {
-        if (_is_vertical(b->inst)) hh = 16 * e_scale;
-        else ww = 16 * e_scale;
+        if (_is_vertical(b->inst))
+          h = 16 * e_scale;
+        else
+          w = 16 * e_scale;
         evas_object_size_hint_min_set(b->o_sep, 8, 8);
-        evas_object_size_hint_max_set(b->o_sep, ww, hh);
+        evas_object_size_hint_max_set(b->o_sep, w, h);
      }
    elm_box_recalculate(b->o_box);
    elm_box_recalculate(b->o_outerbox);
-   evas_object_smart_calculate(b->o_outerbox);
-   evas_object_smart_calculate(b->o_box);
    evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
-   if (b->inst->gcc->max.w) w = MIN(w, b->inst->gcc->max.w);
-   if (b->inst->gcc->max.h) h = MIN(h, b->inst->gcc->max.h);
-   evas_object_resize(b->o_outerbox, w, h);
-
+   if ((!w) || (!h)) return;
    e_gadcon_client_min_size_set(b->inst->gcc, w, h);
    e_gadcon_client_aspect_set(b->inst->gcc, w, h);
 }
diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c
index 7bf5ea2..254bd62 100644
--- a/src/modules/ibox/e_mod_main.c
+++ b/src/modules/ibox/e_mod_main.c
@@ -205,7 +205,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, 
const char *style)
                         drop, 1, x, y, w, h);
    evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
                                   _ibox_cb_obj_moveresize, inst);
-   evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+   evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
                                   _ibox_cb_obj_moveresize, inst);
    ibox_config->instances = eina_list_append(ibox_config->instances, inst);
    // add highest priority iconify provider - tasks and ibar can do this
@@ -476,10 +476,10 @@ _ibox_resize_handle(IBox *b)
    int w, h;
 
    evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
-   if (b->inst->gcc->max.w) w = MIN(w, b->inst->gcc->max.w);
-   if (b->inst->gcc->max.h) h = MIN(h, b->inst->gcc->max.h);
-   if (elm_box_horizontal_get(b->o_box)) w = h;
-   else h = w;
+   if (elm_box_horizontal_get(b->o_box))
+     w = h;
+   else
+     h = w;
    EINA_LIST_FOREACH(b->icons, l, ic)
      {
         evas_object_size_hint_min_set(ic->o_holder, w, h);

-- 


Reply via email to