forked from enlightenment/enlightenment
maintain "empty" object's size hints when ibar/ibox resizes
the sizing issue in all of these tickets was caused by the "empty" object being deleted, thus allowing the box to reset to 0x0 size hints and returning this value as the overall size during recalc; the result is that all icons would be sized at 0x0 instead of using the preserved orient size as expected fix T4509, T4647, T4830, T4733, T4524
This commit is contained in:
parent
3b1242e314
commit
fd6b264b1d
|
@ -510,13 +510,9 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ibar_empty_handle(IBar *b)
|
_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));
|
b->o_empty = evas_object_rectangle_add(evas_object_evas_get(b->o_box));
|
||||||
E_EXPAND(b->o_empty);
|
E_EXPAND(b->o_empty);
|
||||||
E_FILL(b->o_empty);
|
E_FILL(b->o_empty);
|
||||||
|
@ -524,21 +520,10 @@ _ibar_empty_handle(IBar *b)
|
||||||
EVAS_CALLBACK_MOUSE_DOWN,
|
EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_ibar_cb_empty_mouse_down, b);
|
_ibar_cb_empty_mouse_down, b);
|
||||||
evas_object_color_set(b->o_empty, 0, 0, 0, 0);
|
evas_object_color_set(b->o_empty, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
if (b->icons) return;
|
||||||
evas_object_show(b->o_empty);
|
evas_object_show(b->o_empty);
|
||||||
elm_box_pack_end(b->o_box, 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -655,6 +640,13 @@ _ibar_resize_handle(IBar *b)
|
||||||
w = h;
|
w = h;
|
||||||
else
|
else
|
||||||
h = w;
|
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)
|
EINA_INLIST_FOREACH(b->icons, ic)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(ic->o_holder, w, h);
|
evas_object_size_hint_min_set(ic->o_holder, w, h);
|
||||||
|
|
|
@ -371,33 +371,18 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ibox_empty_handle(IBox *b)
|
_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));
|
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_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_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_EXPAND(b->o_empty);
|
||||||
E_FILL(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;
|
|
||||||
}
|
}
|
||||||
|
if (b->icons) return;
|
||||||
|
evas_object_show(b->o_empty);
|
||||||
|
elm_box_pack_end(b->o_box, b->o_empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -480,6 +465,13 @@ _ibox_resize_handle(IBox *b)
|
||||||
w = h;
|
w = h;
|
||||||
else
|
else
|
||||||
h = w;
|
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)
|
EINA_LIST_FOREACH(b->icons, l, ic)
|
||||||
{
|
{
|
||||||
evas_object_size_hint_min_set(ic->o_holder, w, h);
|
evas_object_size_hint_min_set(ic->o_holder, w, h);
|
||||||
|
|
Loading…
Reference in New Issue