From 924da909486660b90c78758bf9861033138b9462 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Wed, 24 Jun 2015 18:28:40 +0900 Subject: [PATCH] add transition for buttons Change-Id: Id08e1e47af5449382ee46d34a1690211f72a4516 Signed-off-by: Minkyu Kang --- res/edc/widgets/button.edc | 71 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc index f58ba5c..1c65ac3 100644 --- a/res/edc/widgets/button.edc +++ b/res/edc/widgets/button.edc @@ -16,6 +16,7 @@ #define STATE_PLAY 0 #define STATE_PAUSE 1 +#define TRANSITION_TIME 0.17 group { name: "elm/button/base/menu_btn"; @@ -109,7 +110,7 @@ group { target: "bg"; target: "elm.text"; target: "bottom_line"; - transition: LINEAR 0.17; + transition: LINEAR TRANSITION_TIME; } program { name: "unfocused"; @@ -119,7 +120,7 @@ group { target: "bg"; target: "elm.text"; target: "bottom_line"; - transition: LINEAR 0.17; + transition: LINEAR TRANSITION_TIME; } } } @@ -184,19 +185,19 @@ group { name: "focused"; signal: "elm,action,focus"; source: "elm"; - script { - set_state(PART:"bg", "selected", 0.0); - set_state(PART:"color", "selected", 0.0); - } + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; } program { name: "unfocused"; signal: "elm,action,unfocus"; source: "elm"; - script { - set_state(PART:"bg", "default", 0.0); - set_state(PART:"color", "default", 0.0); - } + action: STATE_SET "default" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; } } } @@ -317,6 +318,16 @@ group { } parts { part { + name: "color"; + description { + state: "default_pause" 0.0; + } + description { + state: "selected_pause" 0.0; + color: COLOR_BTN_FOCUS; + } + } + part { name: "bg"; scale: 1; description { @@ -414,11 +425,9 @@ group { state = get_int(cur_state); if (state == STATE_PLAY) - set_state(PART:"bg", "selected", 0.0); + run_program(PROGRAM:"focused,play"); else - set_state(PART:"bg", "selected_pause", 0.0); - - set_state(PART:"color", "selected", 0.0); + run_program(PROGRAM:"focused,pause"); } } program { @@ -430,12 +439,38 @@ group { state = get_int(cur_state); if (state == STATE_PLAY) - set_state(PART:"bg", "default", 0.0); + run_program(PROGRAM:"unfocused,play"); else - set_state(PART:"bg", "default_pause", 0.0); - - set_state(PART:"color", "default", 0.0); + run_program(PROGRAM:"unfocused,pause"); } } + program { + name: "focused,play"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; + } + program { + name: "focused,pause"; + action: STATE_SET "selected_pause" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; + } + program { + name: "unfocused,play"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; + } + program { + name: "unfocused,pause"; + action: STATE_SET "default_pause" 0.0; + target: "bg"; + target: "color"; + transition: LINEAR TRANSITION_TIME; + } } } -- 2.7.4