From: Jeonghyun Yun Date: Wed, 27 Dec 2017 05:56:16 +0000 (+0900) Subject: elm_colorselector: add callback for elm,state,selected for backward X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~664 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75a4e55176f3aa9a9c3a8e273afc718419e0f9f3;p=platform%2Fupstream%2Fefl.git elm_colorselector: add callback for elm,state,selected for backward @tizen_fix Change-Id: I9a93dd38cc1c3a97d8c32b74a17fb5853dad4009 Signed-off-by: Jeonghyun Yun --- diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index 6282f28..22dfaf5 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1626,8 +1626,10 @@ _on_color_released(void *data, void *event_info) { Elm_Color_Item_Data *item = (Elm_Color_Item_Data *)data; + /* TIZEN_ONLY(20160517): item selection procedure is handled by _on_color_selected() Eina_List *l; Elm_Object_Item *eo_temp_item; + */ Evas_Event_Mouse_Down *ev = event_info; if (!item) return; @@ -1641,6 +1643,7 @@ _on_color_released(void *data, return; elm_object_signal_emit(VIEW(item), "elm,state,selected", "elm"); + /* TIZEN_ONLY(20160517): item selection procedure is handled by _on_color_selected() elm_colorselector_color_set(WIDGET(item), item->color->r, item->color->g, item->color->b, item->color->a); efl_event_callback_legacy_call @@ -1659,7 +1662,45 @@ _on_color_released(void *data, if (item == temp_item) sd->selected = l; } sd->focused = ELM_COLORSELECTOR_PALETTE; + */ +} + +// TIZEN_ONLY(20160517): "elm,state,selected" signal is handled by _on_color_selected() +static void +_on_color_selected(void *data, + Evas_Object *obj EINA_UNUSED, + const char *emission EINA_UNUSED, + const char *source EINA_UNUSED) + +{ + Elm_Color_Item_Data *item = (Elm_Color_Item_Data *)data; + Eina_List *l; + Elm_Object_Item *eo_temp_item; + + if (!item) return; + + ELM_COLORSELECTOR_DATA_GET(WIDGET(item), sd); + + eo_temp_item = eina_list_data_get(sd->selected); + if (eo_temp_item && (eo_temp_item != EO_OBJ(item))) + { + ELM_COLOR_ITEM_DATA_GET(eo_temp_item, temp_item); + elm_object_signal_emit(VIEW(temp_item), "elm,state,unselected", "elm"); + } + + EINA_LIST_FOREACH(sd->items, l, eo_temp_item) + { + ELM_COLOR_ITEM_DATA_GET(eo_temp_item, temp_item); + if (item == temp_item) sd->selected = l; + } + sd->focused = ELM_COLORSELECTOR_PALETTE; + + elm_colorselector_color_set(WIDGET(item), item->color->r, item->color->g, + item->color->b, item->color->a); + efl_event_callback_legacy_call + (WIDGET(item), ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, EO_OBJ(item)); } +// static char * _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED) @@ -1797,6 +1838,9 @@ _elm_color_item_efl_object_constructor(Eo *eo_item, Elm_Color_Item_Data *item) (item->color_obj, EVAS_CALLBACK_MOUSE_MOVE, _on_color_moved, item); evas_object_event_callback_add (item->color_obj, EVAS_CALLBACK_MOUSE_UP, _on_color_released, item); + // TIZEN_ONLY(20160517): "elm,state,selected" signal is handled by _on_color_selected() + efl_layout_signal_callback_add(VIEW(item), "elm,state,selected", "elm", _on_color_selected, item); + // elm_object_part_content_set(VIEW(item), "color_obj", item->color_obj); _item_sizing_eval(item);