summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-01 21:49:31 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-02 17:14:58 +0200
commit50030dc69346c209109c36bb41631b176c85b2c5 (patch)
tree0eef90fbeffe5ee09e77c1790700e6c14e68988b
parentd98c24bbabbc57aa45129ab5a09b2dbe80bebc2d (diff)
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.c24
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 d810b3dd7..1cce3a8e1 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -638,12 +638,28 @@ static void
638_ibar_resize_handle(IBar *b) 638_ibar_resize_handle(IBar *b)
639{ 639{
640 IBar_Icon *ic; 640 IBar_Icon *ic;
641 Evas_Coord w, h, ww, hh; 641 Evas_Coord w, h, w2, h2, ww = 0, hh = 0;
642 int max_w, max_h;
642 643
643 if (!b->inst->gcc) return; 644 if (!b->inst->gcc) return;
644 evas_object_geometry_get(b->o_outerbox, NULL, NULL, &ww, &hh); 645
645 if (b->inst->gcc->max.w) ww = MIN(ww, b->inst->gcc->max.w); 646 if (b->inst->gcc->gadcon->shelf)
646 if (b->inst->gcc->max.h) hh = MIN(hh, b->inst->gcc->max.h); 647 {
648 /* we are in a shelf */
649 ww = hh = b->inst->gcc->gadcon->shelf->cfg->size;
650 }
651 else if (b->inst->gcc->max.w || b->inst->gcc->max.h)
652 {
653 evas_object_geometry_get(b->o_outerbox, NULL, NULL, &ww, &hh);
654 ww = MIN(b->inst->gcc->max.w, ww);
655 hh = MIN(b->inst->gcc->max.h, hh);
656 }
657
658 /* Fallback to a size for the case noone gives a max size and no shelf config is there */
659 if (ww == 0) ww = 40;
660 if (hh == 0) hh = 40;
661
662
647 if (elm_box_horizontal_get(b->o_box)) ww = hh; 663 if (elm_box_horizontal_get(b->o_box)) ww = hh;
648 else hh = ww; 664 else hh = ww;
649 EINA_INLIST_FOREACH(b->icons, ic) 665 EINA_INLIST_FOREACH(b->icons, ic)