summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-03-10 16:51:44 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-03-10 16:51:44 +0900
commitd4eaee4eb97210ed153c161fc8b7d21967f61131 (patch)
tree4330dd0e0d2b5de182352b6014235a54ee21f955
parent39f60f05c0bd5281d7fee6b8767ac176aebea47c (diff)
popup: correct popup position.
actually popup position should be updated when it's parent is moved. @fix
-rw-r--r--src/lib/elc_popup.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index 86963106b..58a08800f 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -43,7 +43,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
43}; 43};
44 44
45static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); 45static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
46static void _parent_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED); 46static void _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
47 47
48static const Elm_Action key_actions[] = { 48static const Elm_Action key_actions[] = {
49 {"move", _key_action_move}, 49 {"move", _key_action_move},
@@ -195,7 +195,8 @@ _elm_popup_evas_object_smart_del(Eo *obj, Elm_Popup_Data *sd)
195{ 195{
196 unsigned int i; 196 unsigned int i;
197 197
198 evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); 198 evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_RESIZE, _parent_geom_cb, obj);
199 evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_MOVE, _parent_geom_cb, obj);
199 200
200 evas_object_smart_callback_del 201 evas_object_smart_callback_del
201 (sd->notify, "block,clicked", _block_clicked_cb); 202 (sd->notify, "block,clicked", _block_clicked_cb);
@@ -1419,12 +1420,19 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
1419} 1420}
1420 1421
1421static void 1422static void
1422_parent_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 1423_parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
1423{ 1424{
1424 Evas_Coord w, h; 1425 Evas_Coord x, y, w, h;
1425 Evas_Object *popup = data; 1426 Evas_Object *popup = data;
1426 1427
1427 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 1428 if (eo_isa(obj, ELM_WIN_CLASS))
1429 {
1430 x = 0;
1431 y = 0;
1432 }
1433
1434 evas_object_geometry_get(obj, &x, &y, &w, &h);
1435 evas_object_move(popup, x, y);
1428 evas_object_resize(popup, w, h); 1436 evas_object_resize(popup, w, h);
1429} 1437}
1430 1438
@@ -1443,7 +1451,8 @@ _elm_popup_elm_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *paren
1443 evas_object_resize(obj, w, h); 1451 evas_object_resize(obj, w, h);
1444 1452
1445 sd->parent = parent; 1453 sd->parent = parent;
1446 evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj); 1454 evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_geom_cb, obj);
1455 evas_object_event_callback_add(parent, EVAS_CALLBACK_MOVE, _parent_geom_cb, obj);
1447} 1456}
1448 1457
1449EOLIAN static void 1458EOLIAN static void