elm list: Fixed elm_list_item_disabled_set() API. Closed trac #844.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 29 Aug 2011 05:10:20 +0000 (05:10 +0000)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 29 Aug 2011 05:10:20 +0000 (05:10 +0000)
SVN revision: 62932

data/themes/widgets/list.edc
src/lib/elm_list.c

index b5c69a6..8a12592 100644 (file)
@@ -54,6 +54,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "bg";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -87,6 +88,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "elm.swallow.icon";
+         clip_to: "disclip";
          type: SWALLOW;
          description { state: "default" 0.0;
             fixed: 1 0;
@@ -102,6 +104,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "elm.swallow.end";
+         clip_to: "disclip";
          type: SWALLOW;
          description { state: "default" 0.0;
             fixed: 1 0;
@@ -117,6 +120,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "elm.text";
+         clip_to: "disclip";
          type:           TEXT;
          effect:         SOFT_SHADOW;
          mouse_events:   0;
@@ -152,6 +156,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "fg1";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -171,6 +176,7 @@ group { name: "elm/list/item/default";
          }
       }
       part { name: "fg2";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -188,6 +194,17 @@ group { name: "elm/list/item/default";
             color: 255 255 255 255;
          }
       }
+      part { name: "disclip";
+         type: RECT;
+         description { state: "default" 0.0;
+            rel1.to: "bg";
+            rel2.to: "bg";
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 255 255 255 64;
+         }
+      }
    }
    programs {
       program {
@@ -211,6 +228,20 @@ group { name: "elm/list/item/default";
          target:  "elm.text";
          transition: LINEAR 0.1;
       }
+      program {
+         name:    "go_disabled";
+         signal:  "elm,state,disabled";
+         source:  "elm";
+         action:  STATE_SET "disabled" 0.0;
+         target:  "disclip";
+      }
+      program {
+         name:    "go_enabled";
+         signal:  "elm,state,enabled";
+         source:  "elm";
+         action:  STATE_SET "default" 0.0;
+         target:  "disclip";
+      }
    }
 }
 group { name: "elm/list/item_odd/default";
@@ -245,6 +276,7 @@ group { name: "elm/list/item_odd/default";
          }
       }
       part { name: "bg";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -279,6 +311,7 @@ group { name: "elm/list/item_odd/default";
       }
       part {
          name:          "elm.swallow.icon";
+         clip_to: "disclip";
          type:          SWALLOW;
          description { state:    "default" 0.0;
             fixed: 1 0;
@@ -295,6 +328,7 @@ group { name: "elm/list/item_odd/default";
       }
       part {
          name:          "elm.swallow.end";
+         clip_to: "disclip";
          type:          SWALLOW;
          description { state:    "default" 0.0;
             fixed: 1 0;
@@ -311,6 +345,7 @@ group { name: "elm/list/item_odd/default";
       }
       part {
          name:           "elm.text";
+         clip_to: "disclip";
          type:           TEXT;
          effect:         SOFT_SHADOW;
          mouse_events:   0;
@@ -346,6 +381,7 @@ group { name: "elm/list/item_odd/default";
          }
       }
       part { name: "fg1";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -365,6 +401,7 @@ group { name: "elm/list/item_odd/default";
          }
       }
       part { name: "fg2";
+         clip_to: "disclip";
          mouse_events: 0;
          description { state: "default" 0.0;
             visible: 0;
@@ -382,6 +419,17 @@ group { name: "elm/list/item_odd/default";
             color: 255 255 255 255;
          }
       }
+      part { name: "disclip";
+         type: RECT;
+         description { state: "default" 0.0;
+            rel1.to: "bg";
+            rel2.to: "bg";
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 255 255 255 64;
+         }
+      }
    }
    programs {
       program {
@@ -405,6 +453,20 @@ group { name: "elm/list/item_odd/default";
          target:  "elm.text";
          transition: LINEAR 0.1;
       }
+      program {
+         name:    "go_disabled";
+         signal:  "elm,state,disabled";
+         source:  "elm";
+         action:  STATE_SET "disabled" 0.0;
+         target:  "disclip";
+      }
+      program {
+         name:    "go_enabled";
+         signal:  "elm,state,enabled";
+         source:  "elm";
+         action:  STATE_SET "default" 0.0;
+         target:  "disclip";
+      }
    }
 }
 group { name: "elm/list/item_compress/default";
index a2c87ba..36b5278 100644 (file)
@@ -695,7 +695,7 @@ _item_highlight(Elm_List_Item *it)
 
    if (!wd) return;
    ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
-   if (it->highlighted) return;
+   if ((it->highlighted) || (it->disabled)) return;
 
    evas_object_ref(obj);
    _elm_list_walk(wd);
@@ -718,6 +718,7 @@ _item_select(Elm_List_Item *it)
 
    if (!wd) return;
    ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
+   if (it->disabled) return;
    if (it->selected)
      {
         if (wd->always_select) goto call;