discomfitor pushed a commit to branch enlightenment-0.19.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=3a0ed0b1c3d41cfd4c1fdf527c5dcdbbad3dc23b

commit 3a0ed0b1c3d41cfd4c1fdf527c5dcdbbad3dc23b
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Sep 15 13:05:21 2015 -0400

    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
---
 src/bin/e_ilist.c        | 21 +++++++++++++++++++++
 src/bin/e_ilist.h        |  1 +
 src/bin/e_widget_ilist.c |  9 +--------
 3 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c
index a29e2a9..0ec7ace 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);
@@ -1389,6 +1390,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 f425291..048b7bf 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);
 }
 

-- 


Reply via email to