forked from enlightenment/efl
popup: correct popup position.
actually popup position should be updated when it's parent is moved. @fix
This commit is contained in:
parent
aa51e5ac24
commit
51b05f466f
|
@ -43,7 +43,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|||
};
|
||||
|
||||
static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
|
||||
static void _parent_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
|
||||
static void _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
|
||||
|
||||
static const Elm_Action key_actions[] = {
|
||||
{"move", _key_action_move},
|
||||
|
@ -195,7 +195,8 @@ _elm_popup_evas_object_smart_del(Eo *obj, Elm_Popup_Data *sd)
|
|||
{
|
||||
unsigned int i;
|
||||
|
||||
evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj);
|
||||
evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_RESIZE, _parent_geom_cb, obj);
|
||||
evas_object_event_callback_del_full(sd->parent, EVAS_CALLBACK_MOVE, _parent_geom_cb, obj);
|
||||
|
||||
evas_object_smart_callback_del
|
||||
(sd->notify, "block,clicked", _block_clicked_cb);
|
||||
|
@ -1419,12 +1420,19 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
|
|||
}
|
||||
|
||||
static void
|
||||
_parent_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
_parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
Evas_Coord x, y, w, h;
|
||||
Evas_Object *popup = data;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||
if (eo_isa(obj, ELM_WIN_CLASS))
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||
evas_object_move(popup, x, y);
|
||||
evas_object_resize(popup, w, h);
|
||||
}
|
||||
|
||||
|
@ -1443,7 +1451,8 @@ _elm_popup_elm_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *paren
|
|||
evas_object_resize(obj, w, h);
|
||||
|
||||
sd->parent = parent;
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj);
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _parent_geom_cb, obj);
|
||||
evas_object_event_callback_add(parent, EVAS_CALLBACK_MOVE, _parent_geom_cb, obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
Loading…
Reference in New Issue