diff options
Diffstat (limited to 'src/lib/elementary/efl_ui_multibuttonentry.c')
-rw-r--r-- | src/lib/elementary/efl_ui_multibuttonentry.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c index 81e2b391ca..18129b0d5b 100644 --- a/src/lib/elementary/efl_ui_multibuttonentry.c +++ b/src/lib/elementary/efl_ui_multibuttonentry.c | |||
@@ -1715,6 +1715,43 @@ elm_multibuttonentry_add(Evas_Object *parent) | |||
1715 | return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); | 1715 | return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); |
1716 | } | 1716 | } |
1717 | 1717 | ||
1718 | static void | ||
1719 | _legacy_focused(void *data, const Efl_Event *ev) | ||
1720 | { | ||
1721 | Efl_Ui_Focus_Object *new_focus; | ||
1722 | Eina_Bool meaningfull_focus_in = EINA_FALSE, meaningfull_focus_out = EINA_FALSE; | ||
1723 | EFL_UI_MULTIBUTTONENTRY_DATA_GET(data, pd); | ||
1724 | |||
1725 | new_focus = efl_ui_focus_manager_focus_get(ev->object); | ||
1726 | |||
1727 | if (efl_isa(ev->info, ELM_WIDGET_CLASS) && elm_widget_parent_get(ev->info) == pd->box) | ||
1728 | { | ||
1729 | meaningfull_focus_out = EINA_TRUE; | ||
1730 | } | ||
1731 | |||
1732 | if (efl_isa(new_focus, ELM_WIDGET_CLASS) && elm_widget_parent_get(new_focus) == pd->box) | ||
1733 | { | ||
1734 | meaningfull_focus_in = EINA_TRUE; | ||
1735 | } | ||
1736 | |||
1737 | if (meaningfull_focus_in && !meaningfull_focus_out) | ||
1738 | { | ||
1739 | efl_event_callback_legacy_call(data, EFL_UI_WIDGET_EVENT_FOCUSED, NULL); | ||
1740 | } | ||
1741 | |||
1742 | if (!meaningfull_focus_in && meaningfull_focus_out) | ||
1743 | { | ||
1744 | efl_event_callback_legacy_call(data, EFL_UI_WIDGET_EVENT_UNFOCUSED, NULL); | ||
1745 | } | ||
1746 | } | ||
1747 | |||
1748 | static void | ||
1749 | _legacy_manager_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) | ||
1750 | { | ||
1751 | efl_event_callback_del(ev->info, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object); | ||
1752 | efl_event_callback_add(efl_ui_focus_user_manager_get(ev->object), EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _legacy_focused, ev->object); | ||
1753 | } | ||
1754 | |||
1718 | EOLIAN static Eo * | 1755 | EOLIAN static Eo * |
1719 | _efl_ui_multibuttonentry_efl_object_constructor(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED) | 1756 | _efl_ui_multibuttonentry_efl_object_constructor(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED) |
1720 | { | 1757 | { |
@@ -1723,6 +1760,9 @@ _efl_ui_multibuttonentry_efl_object_constructor(Eo *obj, Efl_Ui_Multibuttonentry | |||
1723 | evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); | 1760 | evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); |
1724 | efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL); | 1761 | efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL); |
1725 | 1762 | ||
1763 | //listen to manager changes here | ||
1764 | efl_event_callback_add(obj, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _legacy_manager_changed_cb, NULL); | ||
1765 | |||
1726 | return obj; | 1766 | return obj; |
1727 | } | 1767 | } |
1728 | 1768 | ||