efl_ui_popup: remove parent_window_get method
Summary: remove Efl.Ui.Popup's internal method "parent_window_get" Test Plan: elementary_test -to efluipopup Reviewers: jpeg, Jaehyun_Cho, woohyun, herb Reviewed By: Jaehyun_Cho Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5363
This commit is contained in:
parent
2b2bc50e8b
commit
0928335fbc
|
@ -112,12 +112,6 @@ _efl_ui_popup_efl_container_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UN
|
||||||
return efl_content_unset(efl_part(obj, "elm.swallow.content"));
|
return efl_content_unset(efl_part(obj, "elm.swallow.content"));
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Canvas_Object *
|
|
||||||
_efl_ui_popup_parent_window_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
|
|
||||||
{
|
|
||||||
return pd->win_parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup_Align type)
|
_efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup_Align type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,14 +10,6 @@ enum Efl.Ui.Popup.Align {
|
||||||
class Efl.Ui.Popup(Efl.Ui.Layout)
|
class Efl.Ui.Popup(Efl.Ui.Layout)
|
||||||
{
|
{
|
||||||
methods {
|
methods {
|
||||||
@property parent_window @protected {
|
|
||||||
get {
|
|
||||||
[[Get the parent window of Popup.]]
|
|
||||||
}
|
|
||||||
values {
|
|
||||||
window: Efl.Canvas.Object;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bg_set {
|
bg_set {
|
||||||
params {
|
params {
|
||||||
@in file: string; [[The image file path.]]
|
@in file: string; [[The image file path.]]
|
||||||
|
|
|
@ -24,7 +24,12 @@ _anchor_calc(Evas_Object *obj)
|
||||||
Evas_Coord_Size parent_size = {0, 0};
|
Evas_Coord_Size parent_size = {0, 0};
|
||||||
Eina_Position2D pos = {0, 0};
|
Eina_Position2D pos = {0, 0};
|
||||||
|
|
||||||
Evas_Object *parent = efl_ui_popup_parent_window_get(obj);
|
Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
|
||||||
|
if (!parent)
|
||||||
|
{
|
||||||
|
ERR("Cannot find window parent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h);
|
evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h);
|
||||||
evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h);
|
evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h);
|
||||||
|
@ -209,7 +214,14 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd);
|
EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd);
|
||||||
|
|
||||||
efl_event_callback_del(efl_ui_popup_parent_window_get(data), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, data);
|
Evas_Object *parent = efl_provider_find(data, EFL_UI_WIN_CLASS);
|
||||||
|
if (!parent)
|
||||||
|
{
|
||||||
|
ERR("Cannot find window parent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
efl_event_callback_del(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, data);
|
||||||
|
|
||||||
sd->anchor = NULL;
|
sd->anchor = NULL;
|
||||||
efl_ui_popup_align_set(efl_super(data, MY_CLASS), sd->align);
|
efl_ui_popup_align_set(efl_super(data, MY_CLASS), sd->align);
|
||||||
|
@ -222,7 +234,14 @@ _anchor_detach(Evas_Object *obj)
|
||||||
|
|
||||||
if (sd->anchor == NULL) return;
|
if (sd->anchor == NULL) return;
|
||||||
|
|
||||||
efl_event_callback_del(efl_ui_popup_parent_window_get(obj), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
|
||||||
|
if (!parent)
|
||||||
|
{
|
||||||
|
ERR("Cannot find window parent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
efl_event_callback_del(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
|
efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_del(sd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
|
efl_event_callback_del(sd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
|
||||||
|
@ -242,7 +261,14 @@ _efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Evas_Obje
|
||||||
|
|
||||||
_anchor_calc(obj);
|
_anchor_calc(obj);
|
||||||
|
|
||||||
efl_event_callback_add(efl_ui_popup_parent_window_get(obj), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
|
||||||
|
if (!parent)
|
||||||
|
{
|
||||||
|
ERR("Cannot find window parent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
efl_event_callback_add(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_add(anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
efl_event_callback_add(anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_add(anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
|
efl_event_callback_add(anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
|
||||||
efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
|
efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
|
||||||
|
|
Loading…
Reference in New Issue