forked from enlightenment/enlightenment
pager/pager16: fix wrong min values.
Summary: currently, if we shrink pager gadget horizontally, the resize guide (blue rectangle) became smaller (16x16, pager16: 4x4) than real pager size. There was hard-coded min value. calculate min value base on aspect ratio for real. @fix Test Plan: pager -> begin move/resize -> make it small horizontally as much as possible -> check whether the guide is fit on real size. Reviewers: raster, zmike CC: seoz, cedric Differential Revision: https://phab.enlightenment.org/D793
This commit is contained in:
parent
53cee12648
commit
142829e819
|
@ -246,17 +246,28 @@ static void
|
|||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
|
||||
{
|
||||
Instance *inst;
|
||||
int aspect_w, aspect_h;
|
||||
double aspect_ratio;
|
||||
|
||||
inst = gcc->data;
|
||||
if (inst->pager->invert)
|
||||
e_gadcon_client_aspect_set(gcc,
|
||||
inst->pager->ynum * inst->pager->zone->w,
|
||||
inst->pager->xnum * inst->pager->zone->h);
|
||||
{
|
||||
aspect_w = inst->pager->ynum * inst->pager->zone->w;
|
||||
aspect_h = inst->pager->xnum * inst->pager->zone->h;
|
||||
}
|
||||
else
|
||||
e_gadcon_client_aspect_set(gcc,
|
||||
inst->pager->xnum * inst->pager->zone->w,
|
||||
inst->pager->ynum * inst->pager->zone->h);
|
||||
e_gadcon_client_min_size_set(gcc, 16, 16);
|
||||
{
|
||||
aspect_w = inst->pager->xnum * inst->pager->zone->w;
|
||||
aspect_h = inst->pager->ynum * inst->pager->zone->h;
|
||||
}
|
||||
|
||||
e_gadcon_client_aspect_set(gcc, aspect_w, aspect_h);
|
||||
aspect_ratio = (double)aspect_w / (double)aspect_h;
|
||||
|
||||
if (aspect_ratio > 1.0)
|
||||
e_gadcon_client_min_size_set(gcc, 16 * aspect_ratio, 16);
|
||||
else
|
||||
e_gadcon_client_min_size_set(gcc, 16, 16 * aspect_ratio);
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
|
@ -255,17 +255,28 @@ static void
|
|||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
|
||||
{
|
||||
Instance *inst;
|
||||
int aspect_w, aspect_h;
|
||||
double aspect_ratio;
|
||||
|
||||
inst = gcc->data;
|
||||
if (inst->pager->invert)
|
||||
e_gadcon_client_aspect_set(gcc,
|
||||
inst->pager->ynum * inst->pager->zone->w,
|
||||
inst->pager->xnum * inst->pager->zone->h);
|
||||
{
|
||||
aspect_w = inst->pager->ynum * inst->pager->zone->w;
|
||||
aspect_h = inst->pager->xnum * inst->pager->zone->h;
|
||||
}
|
||||
else
|
||||
e_gadcon_client_aspect_set(gcc,
|
||||
inst->pager->xnum * inst->pager->zone->w,
|
||||
inst->pager->ynum * inst->pager->zone->h);
|
||||
e_gadcon_client_min_size_set(gcc, 4, 4);
|
||||
{
|
||||
aspect_w = inst->pager->xnum * inst->pager->zone->w;
|
||||
aspect_h = inst->pager->ynum * inst->pager->zone->h;
|
||||
}
|
||||
|
||||
e_gadcon_client_aspect_set(gcc, aspect_w, aspect_h);
|
||||
aspect_ratio = (double)aspect_w / (double)aspect_h;
|
||||
|
||||
if (aspect_ratio > 1.0)
|
||||
e_gadcon_client_min_size_set(gcc, 4 * aspect_ratio, 4);
|
||||
else
|
||||
e_gadcon_client_min_size_set(gcc, 4, 4 * aspect_ratio);
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
Loading…
Reference in New Issue