From e055f49f3b9b453dc0d25929d6a918afe0c82b19 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 14 Aug 2017 11:08:47 +0900 Subject: Support visual effect in check widget Change-Id: Ia31d1782d0a78182c5d2be83fe55d07a64171705 Signed-off-by: Jihoon Kim --- im_setting_list/input_method_setting_list_ui.cpp | 32 +++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/im_setting_list/input_method_setting_list_ui.cpp b/im_setting_list/input_method_setting_list_ui.cpp index f9e5d68..507c638 100644 --- a/im_setting_list/input_method_setting_list_ui.cpp +++ b/im_setting_list/input_method_setting_list_ui.cpp @@ -224,9 +224,10 @@ im_setting_list_check_popup_cancel_cb(void *data, Evas_Object *obj, void *event_ } Eina_Bool state = g_gen_item_data[index].chk_status; - isf_control_set_enable_ime(g_ime_info_list[index].appid, !state); - g_gen_item_data[index].chk_status = !state; - elm_genlist_item_update(g_gen_item_data[index].gen_item); + if (isf_control_set_enable_ime(g_ime_info_list[index].appid, !state) == 0) { + g_gen_item_data[index].chk_status = !state; + elm_genlist_item_update(g_gen_item_data[index].gen_item); + } evas_object_del(cb_data->popup); } @@ -328,9 +329,18 @@ im_setting_list_popup_ok_cb(void *data, Evas_Object *obj, void *event_info) } Eina_Bool state = g_gen_item_data[index].chk_status; - g_gen_item_data[index].chk_status = !state; - isf_control_set_enable_ime(g_ime_info_list[index].appid, !state); - elm_genlist_item_update(g_gen_item_data[index].gen_item); + if (isf_control_set_enable_ime(g_ime_info_list[index].appid, !state) == 0) { + g_gen_item_data[index].chk_status = !state; + Evas_Object *ck = elm_object_item_part_content_get(g_gen_item_data[index].gen_item, "elm.swallow.end"); + if (ck == NULL) { + ck = elm_object_item_part_content_get(g_gen_item_data[index].gen_item, "elm.icon"); + } + + if (ck) { + elm_object_signal_emit(ck, "elm,activate,check,on", "elm"); + elm_check_state_set(ck, !state); + } + } evas_object_del(cb_data->popup); } @@ -366,9 +376,13 @@ static void im_setting_list_item_sel_cb(void *data, Evas_Object *obj, void *even Eina_Bool state = g_gen_item_data[index].chk_status; if (state) { - g_gen_item_data[index].chk_status = !state; - isf_control_set_enable_ime(g_ime_info_list[index].appid, !state); - elm_genlist_item_update(item); + if (isf_control_set_enable_ime(g_ime_info_list[index].appid, !state) == 0) { + if (ck) { + elm_object_signal_emit(ck, "elm,activate,check,off", "elm"); + elm_check_state_set(ck, !state); + } + g_gen_item_data[index].chk_status = !state; + } } else { im_setting_list_show_popup(data, obj, im_setting_list_popup_ok_cb, im_setting_list_popup_cancel_cb); } -- cgit v1.2.3