center desktop gadget editor popups upon the zone they have activated

This commit is contained in:
Mike Blumenkrantz 2016-10-31 12:30:11 -04:00
parent 5d2028a300
commit 35df03a596
1 changed files with 11 additions and 3 deletions

View File

@ -2046,10 +2046,18 @@ E_API Evas_Object *
e_gadget_site_edit(Evas_Object *site)
{
Evas_Object *comp_object, *popup, *editor;
E_Zone *zone;
E_Zone *zone, *czone;
zone = e_comp_object_util_zone_get(site);
if (!zone) zone = e_zone_current_get();
czone = e_zone_current_get();
if (zone != czone)
{
int x, y, w, h;
evas_object_geometry_get(site, &x, &y, &w, &h);
if (E_INTERSECTS(x, y, w, h, czone->x, czone->y, czone->w, czone->h))
zone = czone;
}
popup = elm_popup_add(e_comp->elm);
elm_popup_allow_events_set(popup, 1);
@ -2062,7 +2070,7 @@ e_gadget_site_edit(Evas_Object *site)
evas_object_layer_set(comp_object, E_LAYER_POPUP);
evas_object_show(comp_object);
evas_object_resize(comp_object, zone->w / 2, zone->h / 2);
e_comp_object_util_center(comp_object);
e_comp_object_util_center_on_zone(comp_object, zone);
return comp_object;
}