summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-06 22:31:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-07 14:48:42 +0200
commitd11551050d74b0a6d832e65ebf8561031828158d (patch)
tree81c7ad30c16ddb20c554cb96b090885b04ec3d83
parent54c524f7f6186bffcfc3059e8268fabf618a9797 (diff)
efl_ui_item: fix event emission
with this commit events are emitted correctly, even if the container is already on the way to deletion. Additionally, the codepath that is triggered when the item is selected via clickable is now also going through the selected property. ref 7905 Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D9517
-rw-r--r--src/lib/elementary/efl_ui_item.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index 6e88a84f10..492917c798 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -143,11 +143,17 @@ _item_select(Eo *obj, Efl_Ui_Item_Data *pd)
143{ 143{
144 Efl_Ui_Select_Mode m; 144 Efl_Ui_Select_Mode m;
145 145
146 if (!pd->parent) 146 if (pd->parent)
147 return; 147 {
148 m = efl_ui_select_mode_get(pd->parent); 148 m = efl_ui_select_mode_get(pd->parent);
149 if (m == EFL_UI_SELECT_MODE_NONE || (pd->selected && m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS)) 149 if (m == EFL_UI_SELECT_MODE_NONE || (pd->selected && m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS))
150 return; 150 return;
151 }
152 else
153 {
154 if (pd->selected)
155 return;
156 }
151 157
152 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 158 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
153 159
@@ -191,9 +197,9 @@ _item_unpressed(void *data, const Efl_Event *ev EINA_UNUSED)
191 m = efl_ui_select_mode_get(efl_ui_item_container_get(obj)); 197 m = efl_ui_select_mode_get(efl_ui_item_container_get(obj));
192 198
193 if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) 199 if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected))
194 _item_unselect(obj, pd); 200 efl_ui_selectable_selected_set(obj, EINA_FALSE);
195 else if (m != EFL_UI_SELECT_MODE_NONE) 201 else if (m != EFL_UI_SELECT_MODE_NONE)
196 _item_select(obj, pd); 202 efl_ui_selectable_selected_set(obj, EINA_TRUE);
197} 203}
198 204
199EFL_CALLBACKS_ARRAY_DEFINE(self_listening, 205EFL_CALLBACKS_ARRAY_DEFINE(self_listening,