ctxpopup item have elm_list item internally.
But when elm_ctxpopup item was deleted, elm_list item was not deleted.
elm_list item in elm_ctxpopup item should be deleted in del_pre
when elm_ctxpopup item is deleted by elm_wdg_item_del()
Test Plan:
1. launch elementary_test - ctxpopup
2. click Ctxpopup with label only
3. "Never Show" item should not shown in ctxpopup
Reviewers: jpeg
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5044
Change-Id: I2264a3efbb3050017b89cbbd087042d35eb8830d
Signed-off-by: Jeonghyun Yun <jh0506.yun@samsung.com>
elm_object_item_disabled_set(it, EINA_TRUE);
_ctxpopup_item_new(ctxpopup, "Embryo", NULL);
_ctxpopup_item_new(ctxpopup, "Edje", NULL);
+ it = _ctxpopup_item_new(ctxpopup, "Never Show", NULL);
+ elm_object_item_del(it);
evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
evas_object_move(ctxpopup, x, y);
elm_object_item_signal_emit(ctxpopup_it->list_item, emission, source);
}
+EOLIAN static Eina_Bool
+_elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_ctxpopup_it EINA_UNUSED, Elm_Ctxpopup_Item_Data *ctxpopup_it)
+{
+ ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
+ if (!sd) return EINA_FALSE;
+
+ if (ctxpopup_it->list_item)
+ {
+ eo_unref(ctxpopup_it->list_item);
+ eo_do(ctxpopup_it->list_item, elm_wdg_item_del());
+ ctxpopup_it->list_item = NULL;
+ }
+
+ return EINA_TRUE;
+}
+
// TIZEN_ONLY(20170116): merge eo & header files for different profiles
EOLIAN static void
_elm_ctxpopup_item_elm_widget_item_style_set(Eo *eo_item EINA_UNUSED,
// mobile & wearable only feature
}
-EOLIAN static Eina_Bool
-_elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_item EINA_UNUSED, Elm_Ctxpopup_Item_Data *item EINA_UNUSED)
-{
- // mobile & wearable only feature
- return EINA_TRUE;
-}
-
EOLIAN static Elm_Atspi_State_Set
_elm_ctxpopup_item_elm_interface_atspi_accessible_state_set_get(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Item_Data *it EINA_UNUSED)
{
Eo.Base.destructor;
Elm.Widget_Item.disable;
Elm.Widget_Item.signal_emit;
+ Elm.Widget_Item.del_pre;
Elm.Widget_Item.style.set; // TIZEN_ONLY(20170116): merge eo & header files for different profiles
Elm.Widget_Item.part_text.get;
Elm.Widget_Item.part_text.set;
Elm.Widget_Item.part_content.get;
Elm.Widget_Item.part_content.set;
Elm.Widget_Item.part_content_unset;
- Elm.Widget_Item.del_pre; // TIZEN_ONLY(20170116): merge eo & header files for different profiles
Elm.Widget_Item.focus.set;
Elm.Widget_Item.focus.get;
// TIZEN_ONLY(20170116): merge eo & header files for different profiles