forked from enlightenment/enlightenment
use zone size for un-oriented new gadgets
this is a relative size which I set based on zone size, so avoid the possibility of using unsized site geometry
This commit is contained in:
parent
9eed5f49a8
commit
d216cce6eb
|
@ -894,14 +894,9 @@ _gadget_util_add(E_Gadget_Site *zgs, const char *type, int id)
|
||||||
zgc->w = zgc->h = -1;
|
zgc->w = zgc->h = -1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int w, h;
|
|
||||||
E_Zone *zone = e_zone_current_get();
|
E_Zone *zone = e_zone_current_get();
|
||||||
|
zgc->w = (96 * e_scale) / (double)zone->w;
|
||||||
evas_object_geometry_get(zgc->site->layout, NULL, NULL, &w, &h);
|
zgc->h = (96 * e_scale) / (double)zone->h;
|
||||||
w = MIN(zone->w, w);
|
|
||||||
h = MIN(zone->h, h);
|
|
||||||
zgc->w = (96 * e_scale) / (double)w;
|
|
||||||
zgc->h = (96 * e_scale) / (double)h;
|
|
||||||
}
|
}
|
||||||
zgc->site->gadgets = eina_list_append(zgc->site->gadgets, zgc);
|
zgc->site->gadgets = eina_list_append(zgc->site->gadgets, zgc);
|
||||||
zgs->gadget_list = eina_inlist_append(zgs->gadget_list, EINA_INLIST_GET(zgc));
|
zgs->gadget_list = eina_inlist_append(zgs->gadget_list, EINA_INLIST_GET(zgc));
|
||||||
|
|
Loading…
Reference in New Issue