From c3658d4365f7d2412cf967ba51786d86550b5c2a Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Wed, 29 Apr 2015 10:35:07 +0200 Subject: Handle button text visibility properly Button text's can have several states and those are associated with certain looks. By default, the button is invisible and show() is called on it to make it visible. This patch sets the visible flag properly and adds all potential states we may have, setting the proper font color to match the button skin. Signed-off-by: Olliver Schinagl --- data/themes/default/edc/elm/button.edc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/data/themes/default/edc/elm/button.edc b/data/themes/default/edc/elm/button.edc index 0e58608..4645f9e 100644 --- a/data/themes/default/edc/elm/button.edc +++ b/data/themes/default/edc/elm/button.edc @@ -171,13 +171,23 @@ group { name: "elm/button/base/default"; } visible: 0; } + description { state: "unfocus" 0.0; + inherit: "default" 0.0; + visible: 1; + } description { state: "focus" 0.0; inherit: "default" 0.0; color_class: "button_text_focus"; + visible: 1; } description { state: "clicked" 0.0; inherit: "default" 0.0; color_class: "button_text_focus"; + visible: 1; + } + description { state: "unclicked" 0.0; + inherit: "default" 0.0; + visible: 1; } description { state: "visible" 0.0; inherit: "default" 0.0; @@ -219,15 +229,17 @@ group { name: "elm/button/base/default"; } } programs { - program { name: "button_unfocus"; source: "elm"; + program { name: "button_unfocus"; signal: "elm,action,unfocus"; source: "elm"; - action: STATE_SET "default" 0.0; + action: STATE_SET "unfocus" 0.0; target: "base"; + target: "elm.text"; } - program { name: "button_focus"; source: "elm"; + program { name: "button_focus"; signal: "elm,action,focus"; source: "elm"; action: STATE_SET "focus" 0.0; target: "base"; + target: "elm.text"; } program { signal: "mouse,down,1"; source: "event"; @@ -237,6 +249,7 @@ group { name: "elm/button/base/default"; program { name: "button_click_anim"; action: STATE_SET "clicked" 0.0; target: "base"; + target: "elm.text"; } program { name: "button_unclick"; signal: "mouse,up,1"; source: "event"; @@ -244,8 +257,9 @@ group { name: "elm/button/base/default"; after: "button_unclick_anim"; } program { name: "button_unclick_anim"; - action: STATE_SET "default" 0.0; + action: STATE_SET "unclicked" 0.0; target: "base"; + target: "elm.text"; } program { name: "buttonactivate"; signal: "elm,anim,activate"; source: "elm"; -- cgit v0.12