hermet pushed a commit to branch elementary-1.14.

http://git.enlightenment.org/core/elementary.git/commit/?id=b7c88ec72d7df71aef8ead5551ab9c9c9b2c4bc5

commit b7c88ec72d7df71aef8ead5551ab9c9c9b2c4bc5
Author: divyesh purohit <div.puro...@samsung.com>
Date:   Wed Jul 1 11:02:18 2015 +0900

    elm_datetime: Fix datetime ctxpopup resize issue
    
    Summary:
    In elm_datetime, ctxpopup does not resize
    
    @fix
    
    Test Plan:
    1) Change the scale value in elementary_config to 2.0 (so that a better 
size change in the ctxpopup's can be observed)
    2) Open elementary_test and then the datetime
    3) Click on the first datetime field and observe the ctxpopup's arrow 
position and then close it
    4) Click on the same datetime field again, now observe that the ctxpopup's 
arrow has concided with the diskselector as it wasn't resized properly.
    
    Reviewers: raster, Hermet, shilpasingh, subodh6129, seoz
    
    Reviewed By: shilpasingh, subodh6129
    
    Subscribers: rajeshps, govi, poornima.srinivasan
    
    Differential Revision: https://phab.enlightenment.org/D2628
---
 .../datetime_input_ctxpopup.c                      | 31 +++++++++-------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c 
b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
index c8b345d..05d59dc 100644
--- a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
+++ b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c
@@ -34,12 +34,12 @@ _diskselector_item_free_cb(void *data, Evas_Object *obj 
EINA_UNUSED, void *event
 }
 
 static void
-_ctxpopup_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj, void 
*event_info EINA_UNUSED )
+_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info 
EINA_UNUSED)
 {
-   Evas_Object *diskselector;
-
-   diskselector = elm_object_content_unset(obj);
-   if (diskselector) evas_object_del(diskselector);
+   Ctxpopup_Module_Data *ctx_mod;
+   ctx_mod = (Ctxpopup_Module_Data *)data;
+   evas_object_del(obj);
+   ctx_mod->ctxpopup = NULL;
 }
 
 static void
@@ -140,21 +140,16 @@ _field_clicked_cb(void *data, Evas_Object *obj, void 
*event_info EINA_UNUSED)
 
    snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj));
 
-   if (!ctx_mod->ctxpopup)
-     {
-        ctx_mod->ctxpopup = elm_ctxpopup_add(obj);
-        elm_object_style_set(ctx_mod->ctxpopup, buf);
-        elm_ctxpopup_horizontal_set(ctx_mod->ctxpopup, EINA_TRUE);
-        evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND,
-                                         EVAS_HINT_EXPAND);
-        evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 
0.5);
-        evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed",
-                                       _ctxpopup_dismissed_cb, ctx_mod);
-     }
-
+   ctx_mod->ctxpopup = elm_ctxpopup_add(obj);
+   elm_object_style_set(ctx_mod->ctxpopup, buf);
+   elm_ctxpopup_horizontal_set(ctx_mod->ctxpopup, EINA_TRUE);
+   evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND,
+                                    EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5);
+   evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed",
+                                  _ctxpopup_dismissed_cb, ctx_mod);
    elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj));
 
-   // because of the diskselector behaviour, it is being recreated
    diskselector = 
elm_diskselector_add(elm_widget_top_get(ctx_mod->mod_data.base));
    evas_object_smart_callback_add(diskselector, "clicked", _diskselector_cb, 
NULL);
    elm_object_style_set(diskselector, buf);

-- 


Reply via email to