bryce/gadgets - pass orientation to the style wrapper around the gadget
bryce was missing the ability to espose orientation to the child items, so they were the same irrespective of orientation. i also notice that orientaiont is a simple horiz/vert ... so no ability to special case corners etc. in the theme... :( not sure if this should be changed. also fix the aspect calculation to round up correctly to avoid off-by-1 pixel gaps i noticed with the pager - necessary for the styling in the flat theme to be right.
This commit is contained in:
parent
2e8807c806
commit
a9b303baa5
|
@ -376,6 +376,11 @@ _bryce_style(Evas_Object *site, Eina_Stringshare *name, Evas_Object *g)
|
|||
evas_object_del(ly);
|
||||
return;
|
||||
}
|
||||
if (b->orient == E_GADGET_SITE_ORIENT_HORIZONTAL)
|
||||
elm_layout_signal_emit(ly, "e,state,orient,horizontal", "e");
|
||||
else
|
||||
elm_layout_signal_emit(ly, "e,state,orient,vertical", "e");
|
||||
edje_object_message_signal_process(elm_layout_edje_get(ly));
|
||||
prev = e_gadget_util_layout_style_init(g, ly);
|
||||
elm_object_part_content_set(ly, "e.swallow.content", g);
|
||||
evas_object_smart_callback_call(g, "gadget_reparent", ly);
|
||||
|
|
|
@ -578,16 +578,16 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax
|
|||
switch (aspect)
|
||||
{
|
||||
case EVAS_ASPECT_CONTROL_HORIZONTAL:
|
||||
*hh = (*ww * (double)ay / ax);
|
||||
*hh = (*ww * (double)ay / ax) + 0.99999999;
|
||||
break;
|
||||
case EVAS_ASPECT_CONTROL_VERTICAL:
|
||||
*ww = (*hh * (double)ax / ay);
|
||||
*ww = (*hh * (double)ax / ay) + 0.99999999;
|
||||
break;
|
||||
default:
|
||||
if (IS_HORIZ(zgc->site->orient))
|
||||
*ww = (*hh * (double)ax / ay);
|
||||
*ww = (*hh * (double)ax / ay) + 0.99999999;
|
||||
else if (IS_VERT(zgc->site->orient))
|
||||
*hh = (*ww * (double)ay / ax);
|
||||
*hh = (*ww * (double)ay / ax) + 0.99999999;
|
||||
else if (aspect)
|
||||
{
|
||||
double ar = ax / (double) ay;
|
||||
|
@ -600,9 +600,9 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax
|
|||
*ww = *hh;
|
||||
}
|
||||
else if (ar > 1.0)
|
||||
*hh = (*ww * (double)ay / ax);
|
||||
*hh = (*ww * (double)ay / ax) + 0.99999999;
|
||||
else
|
||||
*ww = (*hh * (double)ax / ay);
|
||||
*ww = (*hh * (double)ax / ay) + 0.99999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue