forked from enlightenment/enlightenment
handle gadget site layouts using accurate parent geometry
This commit is contained in:
parent
42d707909e
commit
7c726172e4
|
@ -877,6 +877,15 @@ _bryce_site_anchor(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
e_bryce_orient(b->bryce, e_gadget_site_orient_get(obj), e_gadget_site_anchor_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_bryce_gadget_size_request(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Evas_Coord_Size *size = event_info;
|
||||
Bryce *b = data;
|
||||
|
||||
edje_object_part_geometry_get(elm_layout_edje_get(b->layout), "e.swallow.content", NULL, NULL, &size->w, &size->h);
|
||||
}
|
||||
|
||||
static void
|
||||
_bryce_orient(Bryce *b)
|
||||
{
|
||||
|
@ -908,6 +917,7 @@ _bryce_orient(Bryce *b)
|
|||
evas_object_smart_callback_add(b->site, "gadget_site_popup", _bryce_gadget_popup, b);
|
||||
evas_object_smart_callback_add(b->site, "gadget_site_locked", _bryce_gadget_locked, b);
|
||||
evas_object_smart_callback_add(b->site, "gadget_site_unlocked", _bryce_gadget_unlocked, b);
|
||||
evas_object_smart_callback_add(b->site, "gadget_site_parent_size_request", _bryce_gadget_size_request, b);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -688,10 +688,16 @@ _site_layout_orient(Evas_Object *o, E_Gadget_Site *zgs)
|
|||
Evas_Object *obj;
|
||||
} *size, *psize = NULL;
|
||||
Eina_List *expand = NULL, *gadgets = NULL;
|
||||
Evas_Coord_Size parent_size;
|
||||
|
||||
evas_object_geometry_get(o, &x, &y, &w, &h);
|
||||
if ((!w) && (!h)) return;
|
||||
parent_size.w = parent_size.h = -1;
|
||||
evas_object_smart_callback_call(elm_object_parent_widget_get(zgs->layout), "gadget_site_parent_size_request", &parent_size);
|
||||
if ((parent_size.w < 0) || (parent_size.h < 0))
|
||||
evas_object_geometry_get(elm_object_parent_widget_get(zgs->layout), NULL, NULL, &bw, &bh);
|
||||
else
|
||||
bw = parent_size.w, bh = parent_size.h;
|
||||
rw = bw, rh = bh;
|
||||
evas_object_size_hint_min_get(o, &mw, &mh);
|
||||
evas_object_size_hint_min_get(zgs->layout, &sw, &sh);
|
||||
|
|
Loading…
Reference in New Issue