forked from enlightenment/enlightenment
changing gadman gadget orientations using menu now guesses new orientation sizes much more accurately
This commit is contained in:
parent
f92175c39f
commit
1d324abd7a
|
@ -1169,39 +1169,30 @@ on_menu_style_inset(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__
|
||||||
static void
|
static void
|
||||||
_menu_style_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
_menu_style_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
|
||||||
{
|
{
|
||||||
int w, h;
|
int ow, oh, w, h;
|
||||||
|
Eina_Bool same;
|
||||||
|
|
||||||
|
same = (((orient == E_GADCON_ORIENT_LEFT) && (gcc->cf->orient == E_GADCON_ORIENT_FLOAT)) ||
|
||||||
|
((orient == E_GADCON_ORIENT_FLOAT) && (gcc->cf->orient == E_GADCON_ORIENT_LEFT)));
|
||||||
gcc->cf->orient = orient;
|
gcc->cf->orient = orient;
|
||||||
|
evas_object_geometry_get(gcc->o_frame, NULL, NULL, &ow, &oh);
|
||||||
|
|
||||||
if (gcc->client_class->func.orient)
|
if (gcc->client_class->func.orient)
|
||||||
gcc->client_class->func.orient(gcc, orient);
|
gcc->client_class->func.orient(gcc, orient);
|
||||||
|
|
||||||
if (orient == E_GADCON_ORIENT_VERT)
|
if (same)
|
||||||
{
|
{
|
||||||
w = DEFAULT_SIZE_W * Man->width;
|
w = ow, h = oh;
|
||||||
if (w < gcc->min.w) w = gcc->min.w;
|
|
||||||
|
|
||||||
if (gcc->aspect.w && gcc->aspect.h)
|
|
||||||
h = ((float)gcc->aspect.h / (float)gcc->aspect.w) * w;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
h = DEFAULT_SIZE_H * Man->height;
|
|
||||||
if (h < gcc->min.h) h = gcc->min.h;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h = DEFAULT_SIZE_H * Man->height;
|
/* just flip aspect */
|
||||||
if (h < gcc->min.h) h = gcc->min.h;
|
w = oh;
|
||||||
|
h = ow;
|
||||||
if (gcc->aspect.w && gcc->aspect.h)
|
|
||||||
w = ((float)gcc->aspect.w / (float)gcc->aspect.h) * h;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
w = DEFAULT_SIZE_W * Man->width;
|
|
||||||
if (w < gcc->min.w) w = gcc->min.w;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcc->max.w = w;
|
||||||
|
gcc->max.h = h;
|
||||||
evas_object_resize(gcc->o_frame, w, h);
|
evas_object_resize(gcc->o_frame, w, h);
|
||||||
_save_widget_position(gcc);
|
_save_widget_position(gcc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue