Elementary genlist: Fixed item disabled set bug and disabled swallow
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 6 May 2011 02:07:00 +0000 (02:07 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 6 May 2011 02:07:00 +0000 (02:07 +0000)
objects as well.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@59228 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c

index 461efe4..cbc703d 100644 (file)
@@ -1694,6 +1694,8 @@ _item_icon_realize(Elm_Genlist_Item *it,
                   edje_object_part_swallow(target, key, ic);
                   evas_object_show(ic);
                   elm_widget_sub_object_add(it->base.widget, ic);
+                  if (it->disabled)
+                    elm_widget_disabled_set(ic, EINA_TRUE);
                }
           }
      }
@@ -3789,7 +3791,7 @@ elm_genlist_item_selected_set(Elm_Genlist_Item *it,
    ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
    Widget_Data *wd = elm_widget_data_get(it->base.widget);
    if (!wd) return;
-   if (it->delete_me) return;
+   if ((it->delete_me) && (it->disabled)) return;
    selected = !!selected;
    if (it->selected == selected) return;
 
@@ -3905,15 +3907,21 @@ elm_genlist_item_disabled_set(Elm_Genlist_Item *it,
                               Eina_Bool         disabled)
 {
    ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
+   Eina_List *l;
+   Evas_Object *obj;
    if (it->disabled == disabled) return;
    if (it->delete_me) return;
    it->disabled = !!disabled;
+   if (it->selected)
+     elm_genlist_item_selected_set(it, EINA_FALSE);
    if (it->realized)
      {
         if (it->disabled)
           edje_object_signal_emit(it->base.view, "elm,state,disabled", "elm");
         else
           edje_object_signal_emit(it->base.view, "elm,state,enabled", "elm");
+        EINA_LIST_FOREACH(it->icon_objs, l, obj)
+          elm_widget_disabled_set(obj, disabled);
      }
 }