aboutsummaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorSung-Taek Hong <sth253.hong@samsung.com>2016-01-04 15:06:52 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-04 15:06:55 -0800
commit0e8baac884cf42159966fe199e6bc85edfb929c4 (patch)
treeffaa1731f9f94a7991644bd973a34cda991d2d9a /data
parentmultibuttonentry: add color classes and text classes. (diff)
downloadelementary-0e8baac884cf42159966fe199e6bc85edfb929c4.tar.gz
button: add color classes
Summary: The following color classes are added. - "button_bg", "button background color" - "button_bg_pressed", "button pressed background color" - "button_bg_disabled", "button disabled background color" - "button_bg_disabled", "button disabled background color" - "button_text_pressed", "button pressed text color" - "button_icon", "button icon color" - "button_icon_pressed", "button pressed icon color" - "button_icon_disabled", "button disabled icon color" Differential Revision: https://phab.enlightenment.org/D3512 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'data')
-rw-r--r--data/themes/colorclasses.edc28
-rw-r--r--data/themes/edc/elm/button.edc95
2 files changed, 110 insertions, 13 deletions
diff --git a/data/themes/colorclasses.edc b/data/themes/colorclasses.edc
index 5d92ec1d5..dbfc3f8b0 100644
--- a/data/themes/colorclasses.edc
+++ b/data/themes/colorclasses.edc
@@ -90,10 +90,38 @@ color_classes {
}
// widgets
+ color_class { name: "button_bg";
+ color: 255 255 255 255;
+ desc: "Text of a button";
+ }
+ color_class { name: "button_bg_pressed";
+ color: 255 255 255 255;
+ desc: "Text of a button";
+ }
+ color_class { name: "button_bg_disabled";
+ color: 255 255 255 255;
+ desc: "Text of a button";
+ }
+ color_class { name: "button_icon";
+ color: 255 255 255 255;
+ desc: "Text of a button";
+ }
+ color_class { name: "button_icon_pressed";
+ color: 255 255 255 255;
+ desc: "Text of a button";
+ }
+ color_class { name: "button_icon_disabled";
+ color: 255 255 255 64;
+ desc: "Text of a button";
+ }
color_class { name: "button_text";
color: FN_COL_DEFAULT;
desc: "Text of a button";
}
+ color_class { name: "button_text_pressed";
+ color: FN_COL_DEFAULT;
+ desc: "Text of a button";
+ }
color_class { name: "button_text_disabled";
color: FN_COL_DISABLE;
desc: "Text of a disabled button";
diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc
index 0088b6d1f..8b9811c56 100644
--- a/data/themes/edc/elm/button.edc
+++ b/data/themes/edc/elm/button.edc
@@ -7,52 +7,76 @@ group { name: "elm/button/base/default";
#define LABEL 2
#define MASK 3
#define DISABLE 4
+#define PRESSED 8
script {
public btmode;
public eval_mode(m) {
new m1 = m & MASK;
new d = m & DISABLE;
+ new p = m & PRESSED;
if (m1 == (ICON | LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
- set_state(PART:"elm.text", "visible", 0.0);
- set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
+ if (!p) {
+ set_state(PART:"elm.text", "visible", 0.0);
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ } else {
+ set_state(PART:"elm.text", "pressed_visible", 0.0);
+ set_state(PART:"icon_clip", "pressed", 0.0);
+ set_state(PART:"base", "pressed", 0.0);
+ }
} else {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
}
} else if (m1 == (ICON)) {
if (!d) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
- set_state(PART:"elm.text", "default", 0.0);
- set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ if (!p) {
+ set_state(PART:"icon_clip", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ } else {
+ set_state(PART:"icon_clip", "pressed", 0.0);
+ set_state(PART:"base", "pressed", 0.0);
+ }
} else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
}
} else if (m1 == (LABEL)) {
if (!d) {
set_state(PART:"elm.swallow.content", "default", 0.0);
set_state(PART:"sizer.content", "default", 0.0);
- set_state(PART:"elm.text", "textonly", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
+ if (!p) {
+ set_state(PART:"elm.text", "textonly", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ } else {
+ set_state(PART:"elm.text", "pressed_textonly", 0.0);
+ set_state(PART:"base", "pressed", 0.0);
+ }
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
set_state(PART:"sizer.content", "default", 0.0);
set_state(PART:"elm.text", "disabled_textonly", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
}
} else {
if (!d) {
@@ -61,12 +85,18 @@ group { name: "elm/button/base/default";
set_state(PART:"elm.text", "icononly", 0.0);
set_state(PART:"icon_clip", "default", 0.0);
set_state(PART:"event", "default", 0.0);
+ if (!p) {
+ set_state(PART:"base", "default", 0.0);
+ } else {
+ set_state(PART:"base", "pressed", 0.0);
+ }
} else {
set_state(PART:"elm.swallow.content", "default", 0.0);
set_state(PART:"sizer.content", "default", 0.0);
set_state(PART:"elm.text", "icononly", 0.0);
set_state(PART:"icon_clip", "disabled", 0.0);
set_state(PART:"event", "disabled", 0.0);
+ set_state(PART:"base", "disabled", 0.0);
}
}
}
@@ -80,19 +110,30 @@ group { name: "elm/button/base/default";
rel1.offset: -1 0;
rel2.offset: 0 1;
fill.smooth: 0;
+ color_class: "button_bg";
}
- desc { "clicked";
+ desc { "pressed";
inherit: "default";
image.normal: "button_clicked.png";
image.border: 5 5 4 6;
+ color_class: "button_bg_pressed";
+ }
+ desc { "disabled";
+ inherit: "default";
+ color_class: "button_bg_disabled";
}
}
rect { "icon_clip";
desc { "default";
+ color_class: "button_icon";
+ }
+ desc { "pressed";
+ inherit: "default";
+ color_class: "button_icon_pressed";
}
desc { "disabled";
inherit: "default";
- color: 255 255 255 64;
+ color_class: "button_icon_disabled";
}
}
swallow { "elm.swallow.content"; nomouse;
@@ -181,6 +222,15 @@ group { name: "elm/button/base/default";
visible: 1;
fixed: 0 0;
}
+ desc { "pressed_visible";
+ inherit: "default";
+ rel1.offset: 2 5;
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ color_class: "button_text_pressed";
+ }
desc { "textonly";
inherit: "default";
text.min: 1 1;
@@ -188,6 +238,14 @@ group { name: "elm/button/base/default";
visible: 1;
fixed: 0 0;
}
+ desc { "pressed_textonly";
+ inherit: "default";
+ text.min: 1 1;
+ text.ellipsis: -1;
+ visible: 1;
+ fixed: 0 0;
+ color_class: "button_text_pressed";
+ }
desc { "disabled_visible";
inherit: "default";
rel1.offset: 2 5;
@@ -225,8 +283,11 @@ group { name: "elm/button/base/default";
after: "button_click_anim";
}
program { name: "button_click_anim";
- action: STATE_SET "clicked" 0.0;
- target: "base";
+ script {
+ new m = get_int(btmode);
+ m |= PRESSED; set_int(btmode, m);
+ eval_mode(m);
+ }
}
program { name: "button_unclick";
signal: "mouse,up,1"; source: "event";
@@ -234,12 +295,15 @@ group { name: "elm/button/base/default";
after: "button_unclick_anim";
}
program { name: "button_unclick_anim";
- action: STATE_SET "default" 0.0;
- target: "base";
+ script {
+ new m = get_int(btmode);
+ m &= ~PRESSED; set_int(btmode, m);
+ eval_mode(m);
+ }
}
program { name: "buttonactivate";
signal: "elm,anim,activate"; source: "elm";
- action: STATE_SET "clicked" 0.0;
+ action: STATE_SET "pressed" 0.0;
target: "base";
after: "button_unpressed_anim";
}
@@ -306,6 +370,7 @@ group { name: "elm/button/base/default";
#undef LABEL
#undef MASK
#undef DISABLE
+#undef PRESSED
}
group { name: "elm/button/base/anchor";
@@ -882,7 +947,7 @@ group { name: "elm/button/base/hoversel_vertical/default";
image.border: 7 7 7 7;
fill.smooth : 0;
}
- desc { "clicked";
+ desc { "pressed";
inherit: "default";
rel1.offset: 0 -2;
rel2.offset: 0 -1;
@@ -891,9 +956,13 @@ group { name: "elm/button/base/hoversel_vertical/default";
}
programs {
program { name: "button_click_anim";
+ action: STATE_SET "pressed" 0.0;
+ target: "base";
target: "select_line";
}
program { name: "button_unclick_anim";
+ action: STATE_SET "default" 0.0;
+ target: "base";
target: "select_line";
}
program { name: "buttonactivate";