From: Mike Blumenkrantz Date: Tue, 15 Sep 2015 17:05:21 +0000 (-0400) Subject: add ilist method for setting disabled state X-Git-Tag: upstream/0.20.0~293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce78226c0e12c9051d8e662fccfaf78c50fd8513;p=platform%2Fupstream%2Fenlightenment.git add ilist method for setting disabled state ilist widget adds items in a deferred queue, resulting in attempts to immediately toggle the disabled state having no effect. now there is a flag so that items added after the disabled flag have been set will have the correct state fix T2730 --- diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c index 01e8950..8953618 100644 --- a/src/bin/e_ilist.c +++ b/src/bin/e_ilist.c @@ -23,6 +23,7 @@ struct _E_Smart_Data unsigned int size; Ecore_Timer *timer; } typebuf; + Eina_Bool disabled : 1; }; static void _e_smart_init(void); @@ -1384,6 +1385,26 @@ _e_ilist_item_new(E_Smart_Data *sd, Evas_Object *icon, Evas_Object *end, const c _e_smart_event_mouse_down, si); evas_object_event_callback_add(si->o_base, EVAS_CALLBACK_MOUSE_UP, _e_smart_event_mouse_up, si); + if (sd->disabled) + edje_object_signal_emit(si->o_base, "e,state,disabled", "e"); + else + edje_object_signal_emit(si->o_base, "e,state,enabled", "e"); return si; } +E_API void +e_ilist_disabled_set(Evas_Object *obj, Eina_Bool set) +{ + E_Ilist_Item *ili; + const Eina_List *l; + + API_ENTRY return; + sd->disabled = !!set; + EINA_LIST_FOREACH(sd->items, l, ili) + { + if (sd->disabled) + edje_object_signal_emit(ili->o_base, "e,state,disabled", "e"); + else + edje_object_signal_emit(ili->o_base, "e,state,enabled", "e"); + } +} diff --git a/src/bin/e_ilist.h b/src/bin/e_ilist.h index c5c6f05..b295aac 100644 --- a/src/bin/e_ilist.h +++ b/src/bin/e_ilist.h @@ -62,5 +62,6 @@ E_API void e_ilist_multi_select (Evas_Object *obj, int n); E_API void e_ilist_range_select (Evas_Object *obj, int n); E_API void e_ilist_item_label_set(E_Ilist_Item *si, const char *label); E_API Eina_Bool e_ilist_custom_edje_file_set(Evas_Object *obj, const char *file, const char *group); +E_API void e_ilist_disabled_set(Evas_Object *obj, Eina_Bool set); #endif #endif diff --git a/src/bin/e_widget_ilist.c b/src/bin/e_widget_ilist.c index c3cbcb6..4163101 100644 --- a/src/bin/e_widget_ilist.c +++ b/src/bin/e_widget_ilist.c @@ -291,14 +291,7 @@ _e_wid_disable_hook(Evas_Object *obj) disabled = e_widget_disabled_get(obj); wd = e_widget_data_get(obj); if (!wd) return; - - EINA_LIST_FOREACH(e_widget_ilist_items_get(obj), l, ili) - { - if (disabled) - edje_object_signal_emit(ili->o_base, "e,state,disabled", "e"); - else - edje_object_signal_emit(ili->o_base, "e,state,enabled", "e"); - } + e_ilist_disabled_set(wd->o_ilist, disabled); evas_object_freeze_events_set(wd->o_scrollframe, disabled); }