bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d9c584eec1bb76c4d7a8f665684fa28b814df8ad
commit d9c584eec1bb76c4d7a8f665684fa28b814df8ad Author: Marcel Hollerbach <[email protected]> Date: Mon Nov 20 21:34:33 2017 +0100 efl_ui_multibuttonentry: migrate to efl_ui_focus_object events this merges the two two events callbacks into one --- src/lib/elementary/efl_ui_multibuttonentry.c | 39 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c index 3a7cd3964a..2a1fe92823 100644 --- a/src/lib/elementary/efl_ui_multibuttonentry.c +++ b/src/lib/elementary/efl_ui_multibuttonentry.c @@ -54,14 +54,12 @@ static Eina_Bool _efl_ui_multibuttonentry_smart_focus_next_enable = EINA_FALSE; static Eina_Bool _efl_ui_multibuttonentry_smart_focus_direction_enable = EINA_TRUE; static void _entry_changed_cb(void *data, const Efl_Event *event); -static void _entry_focus_in_cb(void *data, const Efl_Event *event); -static void _entry_focus_out_cb(void *data, const Efl_Event *event); +static void _entry_focus_changed_cb(void *data, const Efl_Event *event); static void _entry_clicked_cb(void *data, const Efl_Event *event); EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb }, - { EFL_UI_WIDGET_EVENT_FOCUSED, _entry_focus_in_cb }, - { EFL_UI_WIDGET_EVENT_UNFOCUSED, _entry_focus_out_cb }, + { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb }, { EFL_UI_EVENT_CLICKED, _entry_clicked_cb } ); @@ -1048,28 +1046,29 @@ _entry_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) } static void -_entry_focus_in_cb(void *data, const Efl_Event *event EINA_UNUSED) +_entry_focus_changed_cb(void *data, const Efl_Event *event) { - Elm_Multibuttonentry_Item_Data *item = NULL; EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); - if (sd->selected_it) + if (efl_ui_focus_object_focus_get(event->object)) { - item = sd->selected_it; - elm_object_focus_set(sd->entry, EINA_FALSE); - elm_object_focus_set(VIEW(item), EINA_TRUE); - } -} + Elm_Multibuttonentry_Item_Data *item = NULL; -static void -_entry_focus_out_cb(void *data, const Efl_Event *event EINA_UNUSED) -{ - EFL_UI_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(data, sd); - const char *str; + if (sd->selected_it) + { + item = sd->selected_it; + elm_object_focus_set(sd->entry, EINA_FALSE); + elm_object_focus_set(VIEW(item), EINA_TRUE); + } + } + else + { + const char *str; - str = efl_text_get(sd->entry); - if (str && str[0]) - _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL); + str = efl_text_get(sd->entry); + if (str && str[0]) + _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL); + } } static void --
