summaryrefslogtreecommitdiff
path: root/src/modules/gadman/e_mod_gadman.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-08-13 11:04:36 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-08-13 11:04:36 +0100
commit28cc3f0a0a04ad5c29b6054f9ea6056652d46a22 (patch)
treea333275c775003bb4bd2d17a9f19b8d993a8e724 /src/modules/gadman/e_mod_gadman.c
parent0cc522d1285c33909cbb854165c8d96eab540964 (diff)
downloadenlightenment-28cc3f0a0a04ad5c29b6054f9ea6056652d46a22.tar.gz
gadman now respects gadget aspect and sets max size hint while resizing gadgets
Diffstat (limited to 'src/modules/gadman/e_mod_gadman.c')
-rw-r--r--src/modules/gadman/e_mod_gadman.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/modules/gadman/e_mod_gadman.c b/src/modules/gadman/e_mod_gadman.c
index 5b7996cf0b..4af7637b35 100644
--- a/src/modules/gadman/e_mod_gadman.c
+++ b/src/modules/gadman/e_mod_gadman.c
@@ -1320,9 +1320,15 @@ on_top(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const c
my = drag_gcc->dy;
}
+ if (drag_gcc->aspect.w && drag_gcc->aspect.h)
+ {
+ ow = h * drag_gcc->aspect.w / drag_gcc->aspect.h;
+ }
+
evas_object_resize(mover, ow, h);
evas_object_move(mover, ox, my - drag_gcc->dy);
+ drag_gcc->max.w = ow, drag_gcc->max.h = h;
evas_object_resize(drag_gcc->o_frame, ow, h);
evas_object_move(drag_gcc->o_frame, ox, my - drag_gcc->dy);
_save_widget_position(drag_gcc);
@@ -1370,6 +1376,11 @@ on_right(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
/* don't go out of the screen */
if (w > (Man->width - ox)) w = Man->width - ox;
+ if (drag_gcc->aspect.w && drag_gcc->aspect.h)
+ {
+ oh = w * drag_gcc->aspect.h / drag_gcc->aspect.w;
+ }
+ drag_gcc->max.w = w, drag_gcc->max.h = oh;
evas_object_resize(mover, w, oh);
evas_object_resize(drag_gcc->o_frame, w, oh);
_save_widget_position(drag_gcc);
@@ -1415,8 +1426,12 @@ on_down(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
if (h < drag_gcc->min.h) h = drag_gcc->min.h;
/* don't go out of the screen */
if (h > (Man->height - oy)) h = Man->height - oy;
-
+ if (drag_gcc->aspect.w && drag_gcc->aspect.h)
+ {
+ ow = h * drag_gcc->aspect.w / drag_gcc->aspect.h;
+ }
evas_object_resize(mover, ow, h);
+ drag_gcc->max.w = ow, drag_gcc->max.h = h;
evas_object_resize(drag_gcc->o_frame, ow, h);
_save_widget_position(drag_gcc);
}
@@ -1469,10 +1484,14 @@ on_left(void *data, Evas_Object *o __UNUSED__, const char *em __UNUSED__, const
w += mx - drag_gcc->dx;
mx = drag_gcc->dx;
}
-
+ if (drag_gcc->aspect.w && drag_gcc->aspect.h)
+ {
+ oh = w * drag_gcc->aspect.h / drag_gcc->aspect.w;
+ }
evas_object_resize(mover, w, oh);
evas_object_move(mover, mx - drag_gcc->dx, oy);
+ drag_gcc->max.w = w, drag_gcc->max.h = oh;
evas_object_resize(drag_gcc->o_frame, w, oh);
evas_object_move(drag_gcc->o_frame, mx - drag_gcc->dx, oy);
_save_widget_position(drag_gcc);