aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwoochan lee <wc0917.lee@samsung.com>2016-02-02 20:35:17 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-02-02 20:38:14 +0900
commit3da09b9929d70f888bbf71bacb143f3bbefc1dac (patch)
treec833c28ac6e4a3364167f3ff09ad98e0f5451270
parentelm_hoversel: add "escape" key action to dismiss (diff)
downloadelementary-3da09b9929d70f888bbf71bacb143f3bbefc1dac.tar.gz
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 <k.navneet@samsung.com> @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
-rw-r--r--data/themes/edc/elm/multibuttonentry.edc8
-rw-r--r--src/lib/elc_multibuttonentry.c13
2 files changed, 21 insertions, 0 deletions
diff --git a/data/themes/edc/elm/multibuttonentry.edc b/data/themes/edc/elm/multibuttonentry.edc
index 0cca89713..5568b4b63 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 003b227f5..643610e27 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);