yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=0ba8ace6547e0f623cc8fa2d5e0339a27d67e44d

commit 0ba8ace6547e0f623cc8fa2d5e0339a27d67e44d
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Wed Sep 2 19:49:06 2015 +0300

    Update size property fields on win resize.
    
    This is need when e.g. edje layout is applied to window.
    Edje will define window's min size, so size property should be updated,
    because it is used for DnD resize.
---
 src/bin/gui/editor.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index dbfe0ba..1599317 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -1366,10 +1366,11 @@ _has_part(const Gui_Widget *wdg, const char 
*new_part_name, Object_Container_Ite
 }
 
 static Eina_Bool
-_win_resize(void *data EINA_UNUSED, Eo *o, const Eo_Event_Description *desc 
EINA_UNUSED, void *event_info EINA_UNUSED)
+_win_resize(void *data, Eo *o, const Eo_Event_Description *desc EINA_UNUSED, 
void *event_info EINA_UNUSED)
 {
    Evas_Coord ow = 0, oh = 0, minw = 0, minh = 0;
    Eo *fr = NULL;
+   Gui_Widget *wdg = data;
 
    eo_do(o, evas_obj_size_hint_min_get(&minw, &minh));
    eo_do(o, efl_gfx_size_get(&ow, &oh));
@@ -1390,6 +1391,19 @@ _win_resize(void *data EINA_UNUSED, Eo *o, const 
Eo_Event_Description *desc EINA
         eo_do(optional_win, efl_gfx_size_set(ow, oh));
         eo_do(inwin_img, efl_gfx_size_set(ow, oh));
      }
+
+   /* Update numbers in property on win resize according to min. */
+   Gui_Widget_Property *prop;
+   Gui_Value *val;
+   prop = wdg_prop_get(wdg, DB_DEF_EFL_GFX_BASE_CLASS, SIZE_SET);
+   if (prop)
+     {
+        val = prop_value_nth_get(prop, 0);
+        gui_value_int_set(val, ow);
+        val = prop_value_nth_get(prop, 1);
+        gui_value_int_set(val, oh);
+     }
+
    eo_do(o, fr = eo_key_data_get("__editor_frame"));
 
    intptr_t dw, dh;
@@ -2856,13 +2870,13 @@ _widget_add(Gui_Session *session, const Gui_Widget 
*wdg, void *data)
         eo_do(win, eo_key_data_set("__editor_frame", fr));
         eo_do(fr, elm_obj_container_content_set(NULL, iwin));
 
-        eo_do(win, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, 
_win_resize, NULL));
+        eo_do(win, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, 
_win_resize, wdg));
         /* If main object is not a win, add callback on resize event.
          * So when size will be changed in propview, win will be resized. */
         if (!IS_WIN(wdg))
           {
              Eo *o = session_eo_get(session, wdg);
-             eo_do(o, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, 
_win_resize, NULL));
+             eo_do(o, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, 
_win_resize, wdg));
           }
         /* Get size from properties of window. */
         Evas_Coord ox = 150, oy = 50;

-- 


Reply via email to