diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 81710905c..6ecbe1495 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -511,34 +511,19 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA static void _ibar_empty_handle(IBar *b) { - if (!b->icons) + if (!b->o_empty) { - if (!b->o_empty) - { - Evas_Coord w, h; - - b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); - E_EXPAND(b->o_empty); - E_FILL(b->o_empty); - evas_object_event_callback_add(b->o_empty, - EVAS_CALLBACK_MOUSE_DOWN, - _ibar_cb_empty_mouse_down, 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_geometry_get(b->o_box, NULL, NULL, &w, &h); - if (elm_box_horizontal_get(b->o_box)) - w = h; - else - h = w; - evas_object_size_hint_min_set(b->o_empty, w, h); - } - } - else if (b->o_empty) - { - evas_object_del(b->o_empty); - b->o_empty = NULL; + b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); + E_EXPAND(b->o_empty); + E_FILL(b->o_empty); + evas_object_event_callback_add(b->o_empty, + EVAS_CALLBACK_MOUSE_DOWN, + _ibar_cb_empty_mouse_down, b); + evas_object_color_set(b->o_empty, 0, 0, 0, 0); } + if (b->icons) return; + evas_object_show(b->o_empty); + elm_box_pack_end(b->o_box, b->o_empty); } static void @@ -655,6 +640,13 @@ _ibar_resize_handle(IBar *b) w = h; else h = w; + if (w || h) + evas_object_size_hint_min_set(b->o_empty, w, h); + if (b->icons && evas_object_visible_get(b->o_empty)) + { + elm_box_unpack(b->o_box, b->o_empty); + evas_object_hide(b->o_empty); + } EINA_INLIST_FOREACH(b->icons, ic) { evas_object_size_hint_min_set(ic->o_holder, w, h); diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index 254bd6218..df755d7a6 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -372,32 +372,17 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA static void _ibox_empty_handle(IBox *b) { - if (!b->icons) + if (!b->o_empty) { - if (!b->o_empty) - { - Evas_Coord w, h; - - b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); - evas_object_event_callback_add(b->o_empty, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_empty_mouse_down, 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_geometry_get(b->o_box, NULL, NULL, &w, &h); - if (elm_box_horizontal_get(b->o_box)) - w = h; - else - h = w; - E_EXPAND(b->o_empty); - E_FILL(b->o_empty); - evas_object_size_hint_min_set(b->o_empty, w, h); - } - } - else if (b->o_empty) - { - evas_object_del(b->o_empty); - b->o_empty = NULL; + b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box)); + evas_object_event_callback_add(b->o_empty, EVAS_CALLBACK_MOUSE_DOWN, _ibox_cb_empty_mouse_down, b); + evas_object_color_set(b->o_empty, 0, 0, 0, 0); + E_EXPAND(b->o_empty); + E_FILL(b->o_empty); } + if (b->icons) return; + evas_object_show(b->o_empty); + elm_box_pack_end(b->o_box, b->o_empty); } static void @@ -480,6 +465,13 @@ _ibox_resize_handle(IBox *b) w = h; else h = w; + if (w || h) + evas_object_size_hint_min_set(b->o_empty, w, h); + if (b->icons && evas_object_visible_get(b->o_empty)) + { + elm_box_unpack(b->o_box, b->o_empty); + evas_object_hide(b->o_empty); + } EINA_LIST_FOREACH(b->icons, l, ic) { evas_object_size_hint_min_set(ic->o_holder, w, h);