e ibar/ibox port to elm box - fix assumption on resize
so... when ibar/ibox were ported to elm box they assumed elm box would resize itself. this was wrong as it only should have set min size hints. this has been fixed by 96fbea9daecf7040ac63203c4823722fa6d5d73f and this addresses T3031. this requires we fix enlightenment too. @fix
This commit is contained in:
parent
f8d20b2646
commit
0be1551658
|
@ -285,7 +285,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
drop, 3, x, y, w, h);
|
drop, 3, x, y, w, h);
|
||||||
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_MOVE,
|
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_MOVE,
|
||||||
_ibar_cb_obj_moveresize, inst);
|
_ibar_cb_obj_moveresize, inst);
|
||||||
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_ibar_cb_obj_moveresize, inst);
|
_ibar_cb_obj_moveresize, inst);
|
||||||
ibar_config->instances = eina_list_append(ibar_config->instances, inst);
|
ibar_config->instances = eina_list_append(ibar_config->instances, inst);
|
||||||
_ibar_resize_handle(b);
|
_ibar_resize_handle(b);
|
||||||
|
@ -445,8 +445,8 @@ static void
|
||||||
_ibar_free(IBar *b)
|
_ibar_free(IBar *b)
|
||||||
{
|
{
|
||||||
_ibar_empty(b);
|
_ibar_empty(b);
|
||||||
evas_object_del(b->o_outerbox);
|
|
||||||
evas_object_del(b->o_box);
|
evas_object_del(b->o_box);
|
||||||
|
evas_object_del(b->o_outerbox);
|
||||||
if (b->o_drop) evas_object_del(b->o_drop);
|
if (b->o_drop) evas_object_del(b->o_drop);
|
||||||
if (b->o_drop_over) evas_object_del(b->o_drop_over);
|
if (b->o_drop_over) evas_object_del(b->o_drop_over);
|
||||||
if (b->o_empty) evas_object_del(b->o_empty);
|
if (b->o_empty) evas_object_del(b->o_empty);
|
||||||
|
@ -526,7 +526,7 @@ _ibar_empty_handle(IBar *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);
|
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);
|
evas_object_size_hint_min_get(b->o_box, &w, &h);
|
||||||
if (elm_box_horizontal_get(b->o_box))
|
if (elm_box_horizontal_get(b->o_box))
|
||||||
w = h;
|
w = h;
|
||||||
else
|
else
|
||||||
|
@ -638,27 +638,18 @@ static void
|
||||||
_ibar_resize_handle(IBar *b)
|
_ibar_resize_handle(IBar *b)
|
||||||
{
|
{
|
||||||
IBar_Icon *ic;
|
IBar_Icon *ic;
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h, xx, yy, ww, hh;
|
||||||
|
|
||||||
if (!b->inst->gcc) return;
|
if (!b->inst->gcc) return;
|
||||||
elm_box_recalculate(b->o_box);
|
evas_object_geometry_get(b->o_outerbox, NULL, NULL, &ww, &hh);
|
||||||
elm_box_recalculate(b->o_outerbox);
|
if (b->inst->gcc->max.w) ww = MIN(ww, b->inst->gcc->max.w);
|
||||||
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site))
|
if (b->inst->gcc->max.h) hh = MIN(hh, b->inst->gcc->max.h);
|
||||||
evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
|
if (elm_box_horizontal_get(b->o_box)) ww = hh;
|
||||||
else
|
else hh = ww;
|
||||||
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)
|
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, ww, hh);
|
||||||
evas_object_size_hint_max_set(ic->o_holder, w, h);
|
evas_object_size_hint_max_set(ic->o_holder, ww, hh);
|
||||||
}
|
}
|
||||||
if (b->o_sep)
|
if (b->o_sep)
|
||||||
{
|
{
|
||||||
|
@ -667,12 +658,17 @@ _ibar_resize_handle(IBar *b)
|
||||||
else
|
else
|
||||||
w = 16 * e_scale;
|
w = 16 * e_scale;
|
||||||
evas_object_size_hint_min_set(b->o_sep, 8, 8);
|
evas_object_size_hint_min_set(b->o_sep, 8, 8);
|
||||||
evas_object_size_hint_max_set(b->o_sep, w, h);
|
evas_object_size_hint_max_set(b->o_sep, ww, hh);
|
||||||
}
|
}
|
||||||
elm_box_recalculate(b->o_box);
|
elm_box_recalculate(b->o_box);
|
||||||
elm_box_recalculate(b->o_outerbox);
|
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);
|
evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
|
||||||
if ((!w) || (!h)) return;
|
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);
|
||||||
|
|
||||||
e_gadcon_client_min_size_set(b->inst->gcc, w, h);
|
e_gadcon_client_min_size_set(b->inst->gcc, w, h);
|
||||||
e_gadcon_client_aspect_set(b->inst->gcc, w, h);
|
e_gadcon_client_aspect_set(b->inst->gcc, w, h);
|
||||||
}
|
}
|
||||||
|
@ -1332,7 +1328,6 @@ _ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec)
|
||||||
edje_object_calc_force(it);
|
edje_object_calc_force(it);
|
||||||
edje_object_size_min_calc(it, &w, &h);
|
edje_object_size_min_calc(it, &w, &h);
|
||||||
evas_object_size_hint_min_set(it, w, h);
|
evas_object_size_hint_min_set(it, w, h);
|
||||||
evas_object_size_hint_min_set(it, w, h);
|
|
||||||
evas_object_show(it);
|
evas_object_show(it);
|
||||||
evas_object_event_callback_add(it, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_icon_menu_mouse_up, ec);
|
evas_object_event_callback_add(it, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_icon_menu_mouse_up, ec);
|
||||||
evas_object_data_set(it, "ibar_icon", ic);
|
evas_object_data_set(it, "ibar_icon", ic);
|
||||||
|
|
|
@ -205,7 +205,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
drop, 1, x, y, w, h);
|
drop, 1, x, y, w, h);
|
||||||
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
|
||||||
_ibox_cb_obj_moveresize, inst);
|
_ibox_cb_obj_moveresize, inst);
|
||||||
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_ibox_cb_obj_moveresize, inst);
|
_ibox_cb_obj_moveresize, inst);
|
||||||
ibox_config->instances = eina_list_append(ibox_config->instances, inst);
|
ibox_config->instances = eina_list_append(ibox_config->instances, inst);
|
||||||
// add highest priority iconify provider - tasks and ibar can do this
|
// add highest priority iconify provider - tasks and ibar can do this
|
||||||
|
@ -476,10 +476,10 @@ _ibox_resize_handle(IBox *b)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
evas_object_geometry_get(b->o_box, NULL, NULL, &w, &h);
|
||||||
if (elm_box_horizontal_get(b->o_box))
|
if (b->inst->gcc->max.w) w = MIN(w, b->inst->gcc->max.w);
|
||||||
w = h;
|
if (b->inst->gcc->max.h) h = MIN(h, b->inst->gcc->max.h);
|
||||||
else
|
if (elm_box_horizontal_get(b->o_box)) w = h;
|
||||||
h = w;
|
else h = w;
|
||||||
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