summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordivyesh purohit <div.purohit@samsung.com>2015-07-01 11:02:18 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-07-01 11:02:18 +0900
commitd12a08d6368a6f2957aa39d7ec085c8d1d1ea974 (patch)
tree38356769bd931c136a8efa948e2d57d209bb4799
parent688813f2cf47cef38d5cb645bde1f77674b5505d (diff)
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
-rw-r--r--src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c31
1 files 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 c8b345de4..05d59dc17 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
34} 34}
35 35
36static void 36static void
37_ctxpopup_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED ) 37_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
38{ 38{
39 Evas_Object *diskselector; 39 Ctxpopup_Module_Data *ctx_mod;
40 40 ctx_mod = (Ctxpopup_Module_Data *)data;
41 diskselector = elm_object_content_unset(obj); 41 evas_object_del(obj);
42 if (diskselector) evas_object_del(diskselector); 42 ctx_mod->ctxpopup = NULL;
43} 43}
44 44
45static void 45static void
@@ -140,21 +140,16 @@ _field_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
140 140
141 snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj)); 141 snprintf(buf, sizeof(buf), "datetime/%s", elm_object_style_get(obj));
142 142
143 if (!ctx_mod->ctxpopup) 143 ctx_mod->ctxpopup = elm_ctxpopup_add(obj);
144 { 144 elm_object_style_set(ctx_mod->ctxpopup, buf);
145 ctx_mod->ctxpopup = elm_ctxpopup_add(obj); 145 elm_ctxpopup_horizontal_set(ctx_mod->ctxpopup, EINA_TRUE);
146 elm_object_style_set(ctx_mod->ctxpopup, buf); 146 evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND,
147 elm_ctxpopup_horizontal_set(ctx_mod->ctxpopup, EINA_TRUE); 147 EVAS_HINT_EXPAND);
148 evas_object_size_hint_weight_set(ctx_mod->ctxpopup, EVAS_HINT_EXPAND, 148 evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5);
149 EVAS_HINT_EXPAND); 149 evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed",
150 evas_object_size_hint_align_set(ctx_mod->ctxpopup, EVAS_HINT_FILL, 0.5); 150 _ctxpopup_dismissed_cb, ctx_mod);
151 evas_object_smart_callback_add(ctx_mod->ctxpopup, "dismissed",
152 _ctxpopup_dismissed_cb, ctx_mod);
153 }
154
155 elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj)); 151 elm_ctxpopup_hover_parent_set(ctx_mod->ctxpopup, elm_widget_top_get(obj));
156 152
157 // because of the diskselector behaviour, it is being recreated
158 diskselector = elm_diskselector_add(elm_widget_top_get(ctx_mod->mod_data.base)); 153 diskselector = elm_diskselector_add(elm_widget_top_get(ctx_mod->mod_data.base));
159 evas_object_smart_callback_add(diskselector, "clicked", _diskselector_cb, NULL); 154 evas_object_smart_callback_add(diskselector, "clicked", _diskselector_cb, NULL);
160 elm_object_style_set(diskselector, buf); 155 elm_object_style_set(diskselector, buf);