princeamd pushed a commit to branch enlightenment-0.17.

commit ed2d213e2e6036103bcbeb8f1de18bf937106dfb
Author: Christopher Michael <[email protected]>
Date:   Tue Feb 19 10:57:35 2013 +0000

    Backport: f4ae6fa :: Add flag to structure for resizing. Add start of 
resize coordinates to structure. If we are manually resizing the object, update 
the text. When resize starts, record the current mouse position and size.
    
    Signed-off-by: Christopher Michael <[email protected]>
    
    SVN revision: 84167
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/modules/conf_randr/e_smart_monitor.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/modules/conf_randr/e_smart_monitor.c 
b/src/modules/conf_randr/e_smart_monitor.c
index a5e6a4a..a9d97f0 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -58,6 +58,12 @@ struct _E_Smart_Data
 
    /* visibility flag */
    Eina_Bool visible : 1;
+
+   /* resizing flag */
+   Eina_Bool resizing : 1;
+
+   /* coordinates where the user clicked to start resizing */
+   Evas_Coord rx, ry;
 };
 
 /* smart function prototypes */
@@ -484,6 +490,9 @@ _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord 
h)
 
    evas_object_resize(sd->o_base, w, h);
    /* evas_object_resize(sd->o_bg, w, h + 30); */
+
+   /* if user is manually resizing the object, then update the size text */
+   if (sd->resizing) _e_smart_monitor_resolution_set(sd, sd->cw, sd->ch);
 }
 
 static void 
@@ -804,6 +813,15 @@ _e_smart_monitor_frame_cb_resize_start(void *data, 
Evas_Object *obj EINA_UNUSED,
 
    /* try to get the monitor smart data */
    if (!(sd = evas_object_smart_data_get(mon))) return;
+
+   /* record current position of mouse */
+   evas_pointer_canvas_xy_get(sd->evas, &sd->rx, &sd->ry);
+
+   /* record current size of monitor */
+   evas_object_grid_pack_get(sd->grid, mon, NULL, NULL, &sd->cw, &sd->ch);
+
+   /* set resizing flag */
+   sd->resizing = EINA_TRUE;
 }
 
 static void 
@@ -817,4 +835,7 @@ _e_smart_monitor_frame_cb_resize_stop(void *data, 
Evas_Object *obj EINA_UNUSED,
 
    /* try to get the monitor smart data */
    if (!(sd = evas_object_smart_data_get(mon))) return;
+
+   /* set resizing flag */
+   sd->resizing = EINA_FALSE;
 }

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to