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:
Wonguk Jeong 2014-05-11 12:30:00 -04:00 committed by Mike Blumenkrantz
parent 53cee12648
commit 142829e819
2 changed files with 36 additions and 14 deletions

View File

@ -246,17 +246,28 @@ static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__) _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
{ {
Instance *inst; Instance *inst;
int aspect_w, aspect_h;
double aspect_ratio;
inst = gcc->data; inst = gcc->data;
if (inst->pager->invert) if (inst->pager->invert)
e_gadcon_client_aspect_set(gcc, {
inst->pager->ynum * inst->pager->zone->w, aspect_w = inst->pager->ynum * inst->pager->zone->w;
inst->pager->xnum * inst->pager->zone->h); aspect_h = inst->pager->xnum * inst->pager->zone->h;
}
else else
e_gadcon_client_aspect_set(gcc, {
inst->pager->xnum * inst->pager->zone->w, aspect_w = inst->pager->xnum * inst->pager->zone->w;
inst->pager->ynum * inst->pager->zone->h); aspect_h = inst->pager->ynum * inst->pager->zone->h;
e_gadcon_client_min_size_set(gcc, 16, 16); }
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 * static const char *

View File

@ -255,17 +255,28 @@ static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__) _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient __UNUSED__)
{ {
Instance *inst; Instance *inst;
int aspect_w, aspect_h;
double aspect_ratio;
inst = gcc->data; inst = gcc->data;
if (inst->pager->invert) if (inst->pager->invert)
e_gadcon_client_aspect_set(gcc, {
inst->pager->ynum * inst->pager->zone->w, aspect_w = inst->pager->ynum * inst->pager->zone->w;
inst->pager->xnum * inst->pager->zone->h); aspect_h = inst->pager->xnum * inst->pager->zone->h;
}
else else
e_gadcon_client_aspect_set(gcc, {
inst->pager->xnum * inst->pager->zone->w, aspect_w = inst->pager->xnum * inst->pager->zone->w;
inst->pager->ynum * inst->pager->zone->h); aspect_h = inst->pager->ynum * inst->pager->zone->h;
e_gadcon_client_min_size_set(gcc, 4, 4); }
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 * static const char *