From 7aa56383a4c057a4a982941d05fe26dbabd1c794 Mon Sep 17 00:00:00 2001 From: Jaime Thomas Date: Thu, 6 Nov 2008 19:04:00 +0000 Subject: [PATCH] Button and check can now be disabled. --- .../data/themes/default/groups/button.edc | 26 +++++++++ .../data/themes/default/groups/check.edc | 54 +++++++++++++++++- .../data/themes/default/groups/erase_disc.edc | 2 +- .../themes/default/images/button_disabled.png | Bin 0 -> 817 bytes .../data/themes/default/images/images.edc | 1 + ecdb/trunk/src/ecdb_gui.c | 40 +++++++++++-- 6 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 ecdb/trunk/data/themes/default/images/button_disabled.png diff --git a/ecdb/trunk/data/themes/default/groups/button.edc b/ecdb/trunk/data/themes/default/groups/button.edc index 3397bd4..a38fffc 100644 --- a/ecdb/trunk/data/themes/default/groups/button.edc +++ b/ecdb/trunk/data/themes/default/groups/button.edc @@ -126,6 +126,16 @@ group { border: 7 7 7 7; } } + + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + + image { + normal: "button_disabled.png"; + border: 11 11 10 10; + } + } } part { @@ -305,6 +315,22 @@ group { target: "focus_clip"; transition: DECELERATE 0.5; } + + program { + name: "disable"; + signal: "ecdb,disable"; + action: STATE_SET "disabled" 0.0; + source: "ecdb"; + target: "button"; + } + + program { + name: "enable"; + signal: "ecdb,enable"; + action: STATE_SET "default" 0.0; + source: "ecdb"; + target: "button"; + } } } diff --git a/ecdb/trunk/data/themes/default/groups/check.edc b/ecdb/trunk/data/themes/default/groups/check.edc index f5bdebb..d5cca5a 100644 --- a/ecdb/trunk/data/themes/default/groups/check.edc +++ b/ecdb/trunk/data/themes/default/groups/check.edc @@ -137,10 +137,16 @@ group { } description { - state: "disabled" 0.0; + state: "disabled_unsel" 0.0; inherit: "default" 0.0; color: 255 255 255 128; } + + description { + state: "disabled_sel" 0.0; + inherit: "active" 0.0; + color: 255 255 255 128; + } } part { @@ -201,5 +207,51 @@ group { toggle_state(); } } + + program { + name: "disabled"; + signal: "ecdb,disable"; + source: "ecdb"; + action: STATE_SET "disabled" 0.0; + target: "check_base"; + target: "check_shadow"; + } + + program { + name: "disabled_check"; + signal: "ecdb,disable"; + source: "ecdb"; + + script { + if (get_int(s) == 1) + set_state(PART:"check", "disabled_sel", + 0.0); + else + set_state(PART:"check", + "disabled_unsel", 0.0); + } + } + + program { + name: "enabled"; + signal: "ecdb,enable"; + source: "ecdb"; + action: STATE_SET "default" 0.0; + target: "check_base"; + target: "check_shadow"; + } + + program { + name: "enabled_check"; + signal: "ecdb,enable"; + source: "ecdb"; + + script { + if (get_int(s) == 1) + set_state(PART:"check", "active", 0.0); + else + set_state(PART:"check", "default", 0.0); + } + } } } diff --git a/ecdb/trunk/data/themes/default/groups/erase_disc.edc b/ecdb/trunk/data/themes/default/groups/erase_disc.edc index 1113f41..15eb7cf 100644 --- a/ecdb/trunk/data/themes/default/groups/erase_disc.edc +++ b/ecdb/trunk/data/themes/default/groups/erase_disc.edc @@ -210,7 +210,7 @@ group { description { state: "visible" 0.0; inherit: "default" 0.0; - color: 255 255 255 160; + color: 255 255 255 0; visible: 1; } } diff --git a/ecdb/trunk/data/themes/default/images/button_disabled.png b/ecdb/trunk/data/themes/default/images/button_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..eab4d9ca46ea921a950fe0ebb3fc7d4c3abfb167 GIT binary patch literal 817 zcmV-11J3-3P)(o@B74c-Td$-(OP4%SnOS0U7g+B+*|8!%|8lNrE_zF&GSp=Xr;O5EskNn;-}t>-9P%gg^+9*V`Dg)sxu@AwUR0yK+6+uG5x zIu@yzF~eTVN>qkHt#K!1l(PYfWhu@_wqIhA6$f^-#q_J1U&S&zsC<%NY)oZTWx!hN z75-amPE)!}Nu_Bz;hdLF)6kRgLo&kU@r%wtY{x+M<_r{p^?(Qz7lvZ93#rkWl!8ylpI8=9ccf;%J z>#t8wPa^=vMsRw)-r)H7_{;wO{s+(VdS#c_3I(korqk&tilWQg+uLuW(dajT6ea&0 v7yy?swr7lKQ~_5w;!3GGfCT`B|0Vwba`;c&pYK-u00000NkvXXu0mjf8?|quick = speed; - /* I need to find a better way to do this... - * Its pretty easy, but a lot more theming work - */ edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb"); + const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin", + "ecdb/erase/speed"}; + ecdb_gui_controls_disable(ids, 3); - /* 1) Disable buttons... - * 2) Start erase + + /* 2) Start erase * 3) Grab a drive * 4) Start burn * 5) Set up progress callback @@ -640,3 +642,31 @@ ecdb_cb_page_hide_finished(void *data, Evas_Object *o, const char *emission, ecdb_page_hide(source); } +static void +ecdb_gui_controls_disable(const char **ids, int n) +{ + Evas_Object *obj; + int i; + + for (i = 0; i < n; i++) + { + obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), + ids[i]); + edje_object_signal_emit(obj, "ecdb,disable", "ecdb"); + } +} + +static void +ecdb_gui_controls_enable(const char **ids, int n) +{ + Evas_Object *obj; + int i; + + for (i = 0; i < n; i++) + { + obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), + ids[i]); + edje_object_signal_emit(obj, "ecdb,enable", "ecdb"); + } +} +