diff options
author | Marcel Hollerbach <marcel-hollerbach@t-online.de> | 2016-09-01 21:49:31 +0200 |
---|---|---|
committer | Marcel Hollerbach <marcel-hollerbach@t-online.de> | 2016-09-02 17:14:58 +0200 |
commit | 50030dc69346c209109c36bb41631b176c85b2c5 (patch) | |
tree | 0eef90fbeffe5ee09e77c1790700e6c14e68988b | |
parent | d98c24bbabbc57aa45129ab5a09b2dbe80bebc2d (diff) | |
download | enlightenment-50030dc69346c209109c36bb41631b176c85b2c5.tar.gz |
ibar: try to get a better min size
There are two cases, on a shelf and on the desktop.
If on a shelf we are using the height setting of the self, since max.w
max.h are only set after a few calcuations, and the gadget does not get
moved on a shelf which does not fade out, so the first min size
calculation must be correct.
If we are on the desktop max.w and max.h are not always 0.
There were some cases when none of this conditions are met. So this
patch enforces a mimum size of 40x40 pixels.
-rw-r--r-- | src/modules/ibar/e_mod_main.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index d810b3dd70..1cce3a8e17 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -638,12 +638,28 @@ static void _ibar_resize_handle(IBar *b) { IBar_Icon *ic; - Evas_Coord w, h, ww, hh; + Evas_Coord w, h, w2, h2, ww = 0, hh = 0; + int max_w, max_h; if (!b->inst->gcc) return; - evas_object_geometry_get(b->o_outerbox, NULL, NULL, &ww, &hh); - if (b->inst->gcc->max.w) ww = MIN(ww, b->inst->gcc->max.w); - if (b->inst->gcc->max.h) hh = MIN(hh, b->inst->gcc->max.h); + + if (b->inst->gcc->gadcon->shelf) + { + /* we are in a shelf */ + ww = hh = b->inst->gcc->gadcon->shelf->cfg->size; + } + 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; EINA_INLIST_FOREACH(b->icons, ic) |