summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarosis <jh0506.yun@samsung.com>2017-08-10 14:02:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-10 14:42:08 +0900
commit080c92658890bc3023aa2568c3f4679987a5154f (patch)
tree4bc0bd0cfc7054df307b21305059b9f6ae02e0a6
parenta28b89304e51d6f857f90654f2cd40bb2d264196 (diff)
elm_ctxpopup: Implemented elm_widget_item_del_pre for elm_ctxpopup_item
Summary: 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, cedric, woohyun Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5044
-rw-r--r--src/bin/elementary/test_ctxpopup.c2
-rw-r--r--src/lib/elementary/elc_ctxpopup.c17
-rw-r--r--src/lib/elementary/elm_ctxpopup_item.eo1
3 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/elementary/test_ctxpopup.c b/src/bin/elementary/test_ctxpopup.c
index 0c1141211b..6be16a50f1 100644
--- a/src/bin/elementary/test_ctxpopup.c
+++ b/src/bin/elementary/test_ctxpopup.c
@@ -159,6 +159,8 @@ _list_item_cb3(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_U
159 elm_object_item_disabled_set(it, EINA_TRUE); 159 elm_object_item_disabled_set(it, EINA_TRUE);
160 _ctxpopup_item_new(ctxpopup, "Embryo", NULL); 160 _ctxpopup_item_new(ctxpopup, "Embryo", NULL);
161 _ctxpopup_item_new(ctxpopup, "Edje", NULL); 161 _ctxpopup_item_new(ctxpopup, "Edje", NULL);
162 it = _ctxpopup_item_new(ctxpopup, "Never Show", NULL);
163 elm_object_item_del(it);
162 164
163 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); 165 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
164 evas_object_move(ctxpopup, x, y); 166 evas_object_move(ctxpopup, x, y);
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index 1a2071044e..9b42539d6b 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -907,6 +907,23 @@ _elm_ctxpopup_item_elm_widget_item_disable(Eo *eo_ctxpopup_it,
907 (ctxpopup_it->list_item, elm_wdg_item_disabled_get(eo_ctxpopup_it)); 907 (ctxpopup_it->list_item, elm_wdg_item_disabled_get(eo_ctxpopup_it));
908} 908}
909 909
910EOLIAN static Eina_Bool
911_elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_ctxpopup_it EINA_UNUSED,
912 Elm_Ctxpopup_Item_Data *ctxpopup_it)
913{
914 ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
915 if (!sd) return EINA_FALSE;
916
917 if (ctxpopup_it->list_item)
918 {
919 efl_unref(ctxpopup_it->list_item);
920 elm_wdg_item_del(ctxpopup_it->list_item);
921 ctxpopup_it->list_item = NULL;
922 }
923
924 return EINA_TRUE;
925}
926
910EOLIAN static void 927EOLIAN static void
911_elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *eo_ctxpopup_it EINA_UNUSED, 928_elm_ctxpopup_item_elm_widget_item_signal_emit(Eo *eo_ctxpopup_it EINA_UNUSED,
912 Elm_Ctxpopup_Item_Data *ctxpopup_it, 929 Elm_Ctxpopup_Item_Data *ctxpopup_it,
diff --git a/src/lib/elementary/elm_ctxpopup_item.eo b/src/lib/elementary/elm_ctxpopup_item.eo
index a6f14e222e..47dd0ff866 100644
--- a/src/lib/elementary/elm_ctxpopup_item.eo
+++ b/src/lib/elementary/elm_ctxpopup_item.eo
@@ -17,6 +17,7 @@ class Elm.Ctxpopup.Item(Elm.Widget.Item, Efl.Ui.Item)
17 Efl.Object.destructor; 17 Efl.Object.destructor;
18 Elm.Widget.Item.disable; 18 Elm.Widget.Item.disable;
19 Elm.Widget.Item.signal_emit; 19 Elm.Widget.Item.signal_emit;
20 Elm.Widget.Item.del_pre;
20 Elm.Widget.Item.part_text { get; set; } 21 Elm.Widget.Item.part_text { get; set; }
21 Elm.Widget.Item.part_content { get; set; } 22 Elm.Widget.Item.part_content { get; set; }
22 Elm.Widget.Item.focus { get; set; } 23 Elm.Widget.Item.focus { get; set; }