From: hermet Date: Mon, 20 Feb 2012 12:04:29 +0000 (+0000) Subject: elementary/flipselector - + disable/enable func X-Git-Tag: REL_F_I9500_20120323_1~17^2~642 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5abdd4ff9bb6ca6863cbffcb7bf5798d386314f;p=framework%2Fuifw%2Felementary.git elementary/flipselector - + disable/enable func git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68155 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/data/themes/widgets/flipselector.edc b/data/themes/widgets/flipselector.edc index a7c8d94..99d9cf1 100644 --- a/data/themes/widgets/flipselector.edc +++ b/data/themes/widgets/flipselector.edc @@ -379,6 +379,7 @@ group { name: "elm/flipselector/base/default"; part { name: "arrow_top"; mouse_events: 0; + clip_to: "disclip"; scale: 1; description { state: "default" 0.0; min: 15 15; @@ -395,6 +396,7 @@ group { name: "elm/flipselector/base/default"; } part { name: "arrow_bottom"; mouse_events: 0; + clip_to: "disclip"; scale: 1; description { state: "default" 0.0; min: 15 15; @@ -414,6 +416,7 @@ group { name: "elm/flipselector/base/default"; type: RECT; mouse_events: 0; name: "top_clipper"; + clip_to: "disclip"; description { state: "default" 0.0; rel1.to: "t"; @@ -426,6 +429,7 @@ group { name: "elm/flipselector/base/default"; type: RECT; mouse_events: 0; name: "bottom_clipper"; + clip_to: "disclip"; description { state: "default" 0.0; rel1.to: "b"; @@ -433,6 +437,35 @@ group { name: "elm/flipselector/base/default"; visible: 1; } } + + part { + type: RECT; + name: "disclip"; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "enabled" 0.0; + color: 100 100 100 100; + } + } + + part { + type: RECT; + name: "event_blocker"; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { + state: "enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } programs { @@ -487,5 +520,19 @@ group { name: "elm/flipselector/base/default"; source: "b"; action: SIGNAL_EMIT "elm,action,down,stop" ""; } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "enabled" 0.0; + target: "disclip"; + target: "event_blocker"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + target: "event_blocker"; + } } } diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 5a33259..b4ab7cb 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -197,7 +197,7 @@ EAPI extern Elm_Version *elm_version; #include //Done #include //Done #include //Done. There are many TODOs in flip.c -#include +#include //Done. #include #include #include diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c index db4659e..292b7d6 100644 --- a/src/lib/elm_flipselector.c +++ b/src/lib/elm_flipselector.c @@ -7,7 +7,6 @@ /* TODO: if one ever wants to extend it to receiving generic widgets as items, be my guest. in this case, remember to implement the items tooltip infra. */ -/* TODO: implement disabled mode -- disable_hook() and stuff. */ /* TODO: fix default theme image borders for looong strings as item labels. */ /* TODO: set text elipsis on labels if one enforces mininum size on @@ -177,6 +176,18 @@ _del_hook(Evas_Object *obj) } static void +_disable_hook(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + if (elm_widget_disabled_get(obj)) + edje_object_signal_emit(wd->base, "elm,state,disabled", "elm"); + else + edje_object_signal_emit(wd->base, "elm,state,enabled", "elm"); +} + +static void _theme_hook(Evas_Object *obj) { Widget_Data *wd; @@ -630,6 +641,7 @@ elm_flipselector_add(Evas_Object *parent) wd->self = obj; elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_disable_hook_set(obj, _disable_hook); elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); diff --git a/src/lib/elm_flipselector.h b/src/lib/elm_flipselector.h index bd2a40e..15cb2c7 100644 --- a/src/lib/elm_flipselector.h +++ b/src/lib/elm_flipselector.h @@ -28,6 +28,10 @@ * Default text parts of the flipselector items that you can use for are: * @li "default" - label of the flipselector item * + * Supported elm_object common APIs. + * @li elm_object_disabled_set + * @li elm_object_disabled_get + * * Supported elm_object_item common APIs. * @li elm_object_item_text_set * @li elm_object_item_part_text_set