From 954d3e31cf7f445c3478e8b3ac46bcd3cc571000 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Mon, 29 Aug 2011 05:10:20 +0000 Subject: [PATCH] elm list: Fixed elm_list_item_disabled_set() API. Closed trac #844. SVN revision: 62932 --- .../elementary/data/themes/widgets/list.edc | 62 +++++++++++++++++++ legacy/elementary/src/lib/elm_list.c | 3 +- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/data/themes/widgets/list.edc b/legacy/elementary/data/themes/widgets/list.edc index b5c69a677d..8a125923da 100644 --- a/legacy/elementary/data/themes/widgets/list.edc +++ b/legacy/elementary/data/themes/widgets/list.edc @@ -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"; diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index a2c87baeb8..36b5278a77 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -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;