hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=3da09b9929d70f888bbf71bacb143f3bbefc1dac
commit 3da09b9929d70f888bbf71bacb143f3bbefc1dac Author: woochan lee <[email protected]> Date: Tue Feb 2 20:35:17 2016 +0900 multibuttonentry: Add item unfocused callback. Summary: Even MBE item lose focus, item state did not changed before. So i send a signal to make item state as default when item lose own focus. Signed-off By: Kumar Navneet <[email protected]> @fix Test Plan: Run MBE sample. Click any item. Click out of MBE area. See the item still got a highlight. Reviewers: Hermet, cedric Differential Revision: https://phab.enlightenment.org/D2994 Conflicts: data/themes/edc/elm/multibuttonentry.edc --- data/themes/edc/elm/multibuttonentry.edc | 8 ++++++++ src/lib/elc_multibuttonentry.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/data/themes/edc/elm/multibuttonentry.edc b/data/themes/edc/elm/multibuttonentry.edc index 0cca897..5568b4b 100644 --- a/data/themes/edc/elm/multibuttonentry.edc +++ b/data/themes/edc/elm/multibuttonentry.edc @@ -121,6 +121,9 @@ group { name: "elm/multibuttonentry/btn/default"; color: 255 255 255 255; visible: 1; } + description { state: "unfocused" 0.0; + inherit: "default" 0.0; + } } part { name: "close"; mouse_events: 0; description { state: "default" 0.0; @@ -242,6 +245,11 @@ group { name: "elm/multibuttonentry/btn/default"; } } program { + signal: "elm,state,unfocused"; source: "elm"; + action: STATE_SET "unfocused" 0.0; + target: "glow"; + } + program { signal: "mouse,down,1"; source: "base"; script { if (get_int(disabled) == 0) { diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index 003b227..643610e 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -546,6 +546,17 @@ _on_item_deleted(void *data, } } +static void +_on_item_unfocused(void *data, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Elm_Multibuttonentry_Item_Data *it = data; + + if (!it) return; + elm_layout_signal_emit(VIEW(it), "elm,state,unfocused", "elm"); +} + static Eina_Bool _long_press_cb(void *data) { @@ -765,6 +776,8 @@ _item_new(Elm_Multibuttonentry_Data *sd, (VIEW(item), "mouse,clicked,1", "*", _on_item_clicked, EO_OBJ(item)); elm_layout_signal_callback_add (VIEW(item), "elm,deleted", "elm", _on_item_deleted, EO_OBJ(item)); + evas_object_smart_callback_add + (VIEW(item), "unfocused", _on_item_unfocused, item); evas_object_event_callback_add (VIEW(item), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, item); --
