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
This commit is contained in:
woochan lee 2016-02-02 20:35:17 +09:00 committed by Hermet Park
parent ef5ff1a9ed
commit 5e19488932
2 changed files with 21 additions and 0 deletions

View File

@ -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;
@ -241,6 +244,11 @@ group { name: "elm/multibuttonentry/btn/default";
set_int(disabled , 1);
}
}
program {
signal: "elm,state,unfocused"; source: "elm";
action: STATE_SET "unfocused" 0.0;
target: "glow";
}
program {
signal: "mouse,down,1"; source: "base";
script {

View File

@ -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);