forked from enlightenment/enlightenment
use current box geometry for calculating desktop ibar/ibox sizing
desktop gadgets don't have minimum size set from parent objects, so it's necessary to use the current object geometry in order to correctly size these gadgets since the top-most widget is from elm fix T2907
This commit is contained in:
parent
7c98372656
commit
d066020bea
|
@ -268,7 +268,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
ci = _ibar_config_item_get(id);
|
ci = _ibar_config_item_get(id);
|
||||||
inst->ci = ci;
|
inst->ci = ci;
|
||||||
if (!ci->dir) ci->dir = eina_stringshare_add("default");
|
if (!ci->dir) ci->dir = eina_stringshare_add("default");
|
||||||
b = _ibar_new(gc->o_container, inst);
|
b = _ibar_new(gc->o_container ?: e_comp->elm, inst);
|
||||||
gcc = e_gadcon_client_new(gc, name, id, style, b->o_outerbox);
|
gcc = e_gadcon_client_new(gc, name, id, style, b->o_outerbox);
|
||||||
e_gadcon_client_autoscroll_toggle_disabled_set(gcc, !ci->dont_add_nonorder);
|
e_gadcon_client_autoscroll_toggle_disabled_set(gcc, !ci->dont_add_nonorder);
|
||||||
gcc->data = inst;
|
gcc->data = inst;
|
||||||
|
@ -287,6 +287,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(b->o_outerbox, EVAS_CALLBACK_RESIZE,
|
||||||
_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);
|
||||||
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify", _ibar_cb_iconify_provider, inst);
|
inst->iconify_provider = e_comp_object_effect_mover_add(80, "e,action,*iconify", _ibar_cb_iconify_provider, inst);
|
||||||
return gcc;
|
return gcc;
|
||||||
}
|
}
|
||||||
|
@ -638,16 +639,17 @@ _ibar_resize_handle(IBar *b)
|
||||||
IBar_Icon *ic;
|
IBar_Icon *ic;
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
|
|
||||||
|
if (!b->inst->gcc) return;
|
||||||
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_size_hint_min_get(b->o_outerbox, &w, &h);
|
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site))
|
||||||
if (b->inst->gcc)
|
evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
|
||||||
{
|
else
|
||||||
if (b->inst->gcc->max.w)
|
evas_object_geometry_get(b->o_outerbox, NULL, NULL, &w, &h);
|
||||||
w = MIN(w, b->inst->gcc->max.w);
|
if (b->inst->gcc->max.w)
|
||||||
if (b->inst->gcc->max.h)
|
w = MIN(w, b->inst->gcc->max.w);
|
||||||
h = MIN(h, b->inst->gcc->max.h);
|
if (b->inst->gcc->max.h)
|
||||||
}
|
h = MIN(h, b->inst->gcc->max.h);
|
||||||
if (elm_box_horizontal_get(b->o_box))
|
if (elm_box_horizontal_get(b->o_box))
|
||||||
w = h;
|
w = h;
|
||||||
else
|
else
|
||||||
|
@ -666,7 +668,6 @@ _ibar_resize_handle(IBar *b)
|
||||||
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, w, h);
|
||||||
}
|
}
|
||||||
if (!b->inst->gcc) return;
|
|
||||||
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_size_hint_min_get(b->o_outerbox, &w, &h);
|
evas_object_size_hint_min_get(b->o_outerbox, &w, &h);
|
||||||
|
|
|
@ -184,7 +184,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
ci = _ibox_config_item_get(id);
|
ci = _ibox_config_item_get(id);
|
||||||
inst->ci = ci;
|
inst->ci = ci;
|
||||||
|
|
||||||
b = _ibox_new(gc->o_container, gc->zone);
|
b = _ibox_new(gc->o_container ?: e_comp->elm, gc->zone);
|
||||||
b->inst = inst;
|
b->inst = inst;
|
||||||
inst->ibox = b;
|
inst->ibox = b;
|
||||||
o = b->o_box;
|
o = b->o_box;
|
||||||
|
@ -448,6 +448,8 @@ _ibox_fill(IBox *b)
|
||||||
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) return;
|
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) return;
|
||||||
elm_box_recalculate(b->o_box);
|
elm_box_recalculate(b->o_box);
|
||||||
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
||||||
|
if ((!mw) && (!mh))
|
||||||
|
evas_object_geometry_get(b->o_box, NULL, NULL, &mw, &mh);
|
||||||
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
||||||
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
||||||
}
|
}
|
||||||
|
@ -1111,6 +1113,8 @@ _ibox_cb_event_client_iconify(void *data EINA_UNUSED, int type EINA_UNUSED, void
|
||||||
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue;
|
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue;
|
||||||
elm_box_recalculate(b->o_box);
|
elm_box_recalculate(b->o_box);
|
||||||
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
||||||
|
if ((!mw) && (!mh))
|
||||||
|
evas_object_geometry_get(b->o_box, NULL, NULL, &mw, &mh);
|
||||||
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
||||||
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
||||||
}
|
}
|
||||||
|
@ -1143,6 +1147,8 @@ _ibox_cb_event_client_uniconify(void *data EINA_UNUSED, int type EINA_UNUSED, vo
|
||||||
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue;
|
if (!e_gadcon_site_is_desktop(b->inst->gcc->gadcon->location->site)) continue;
|
||||||
elm_box_recalculate(b->o_box);
|
elm_box_recalculate(b->o_box);
|
||||||
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
evas_object_size_hint_min_get(b->o_box, &mw, &mh);
|
||||||
|
if ((!mw) && (!mh))
|
||||||
|
evas_object_geometry_get(b->o_box, NULL, NULL, &mw, &mh);
|
||||||
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
evas_object_geometry_get(b->inst->gcc->o_frame, NULL, NULL, NULL, &h);
|
||||||
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
evas_object_resize(b->inst->gcc->o_frame, MIN(mw, b->inst->gcc->gadcon->zone->w), MAX(h, mh));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue