summaryrefslogtreecommitdiff
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
parent4e3e6b8f02d677846aec4106a9fafea61b499f89 (diff)
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>
-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 {
90 } 90 }
91 91
92// widgets 92// widgets
93 color_class { name: "button_bg";
94 color: 255 255 255 255;
95 desc: "Text of a button";
96 }
97 color_class { name: "button_bg_pressed";
98 color: 255 255 255 255;
99 desc: "Text of a button";
100 }
101 color_class { name: "button_bg_disabled";
102 color: 255 255 255 255;
103 desc: "Text of a button";
104 }
105 color_class { name: "button_icon";
106 color: 255 255 255 255;
107 desc: "Text of a button";
108 }
109 color_class { name: "button_icon_pressed";
110 color: 255 255 255 255;
111 desc: "Text of a button";
112 }
113 color_class { name: "button_icon_disabled";
114 color: 255 255 255 64;
115 desc: "Text of a button";
116 }
93 color_class { name: "button_text"; 117 color_class { name: "button_text";
94 color: FN_COL_DEFAULT; 118 color: FN_COL_DEFAULT;
95 desc: "Text of a button"; 119 desc: "Text of a button";
96 } 120 }
121 color_class { name: "button_text_pressed";
122 color: FN_COL_DEFAULT;
123 desc: "Text of a button";
124 }
97 color_class { name: "button_text_disabled"; 125 color_class { name: "button_text_disabled";
98 color: FN_COL_DISABLE; 126 color: FN_COL_DISABLE;
99 desc: "Text of a disabled button"; 127 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";
7#define LABEL 2 7#define LABEL 2
8#define MASK 3 8#define MASK 3
9#define DISABLE 4 9#define DISABLE 4
10#define PRESSED 8
10 script { 11 script {
11 public btmode; 12 public btmode;
12 public eval_mode(m) { 13 public eval_mode(m) {
13 new m1 = m & MASK; 14 new m1 = m & MASK;
14 new d = m & DISABLE; 15 new d = m & DISABLE;
16 new p = m & PRESSED;
15 if (m1 == (ICON | LABEL)) { 17 if (m1 == (ICON | LABEL)) {
16 if (!d) { 18 if (!d) {
17 set_state(PART:"elm.swallow.content", "visible", 0.0); 19 set_state(PART:"elm.swallow.content", "visible", 0.0);
18 set_state(PART:"sizer.content", "visible", 0.0); 20 set_state(PART:"sizer.content", "visible", 0.0);
19 set_state(PART:"elm.text", "visible", 0.0);
20 set_state(PART:"icon_clip", "default", 0.0);
21 set_state(PART:"event", "default", 0.0); 21 set_state(PART:"event", "default", 0.0);
22 if (!p) {
23 set_state(PART:"elm.text", "visible", 0.0);
24 set_state(PART:"icon_clip", "default", 0.0);
25 set_state(PART:"base", "default", 0.0);
26 } else {
27 set_state(PART:"elm.text", "pressed_visible", 0.0);
28 set_state(PART:"icon_clip", "pressed", 0.0);
29 set_state(PART:"base", "pressed", 0.0);
30 }
22 } else { 31 } else {
23 set_state(PART:"elm.swallow.content", "visible", 0.0); 32 set_state(PART:"elm.swallow.content", "visible", 0.0);
24 set_state(PART:"sizer.content", "visible", 0.0); 33 set_state(PART:"sizer.content", "visible", 0.0);
25 set_state(PART:"elm.text", "disabled_visible", 0.0); 34 set_state(PART:"elm.text", "disabled_visible", 0.0);
26 set_state(PART:"icon_clip", "disabled", 0.0); 35 set_state(PART:"icon_clip", "disabled", 0.0);
27 set_state(PART:"event", "disabled", 0.0); 36 set_state(PART:"event", "disabled", 0.0);
37 set_state(PART:"base", "disabled", 0.0);
28 } 38 }
29 } else if (m1 == (ICON)) { 39 } else if (m1 == (ICON)) {
30 if (!d) { 40 if (!d) {
31 set_state(PART:"elm.swallow.content", "icononly", 0.0); 41 set_state(PART:"elm.swallow.content", "icononly", 0.0);
32 set_state(PART:"sizer.content", "icononly", 0.0); 42 set_state(PART:"sizer.content", "icononly", 0.0);
33 set_state(PART:"elm.text", "default", 0.0);
34 set_state(PART:"icon_clip", "default", 0.0);
35 set_state(PART:"event", "default", 0.0); 43 set_state(PART:"event", "default", 0.0);
44 set_state(PART:"elm.text", "default", 0.0);
45 if (!p) {
46 set_state(PART:"icon_clip", "default", 0.0);
47 set_state(PART:"base", "default", 0.0);
48 } else {
49 set_state(PART:"icon_clip", "pressed", 0.0);
50 set_state(PART:"base", "pressed", 0.0);
51 }
36 } else { 52 } else {
37 set_state(PART:"elm.swallow.content", "icononly", 0.0); 53 set_state(PART:"elm.swallow.content", "icononly", 0.0);
38 set_state(PART:"sizer.content", "icononly", 0.0); 54 set_state(PART:"sizer.content", "icononly", 0.0);
39 set_state(PART:"elm.text", "default", 0.0); 55 set_state(PART:"elm.text", "default", 0.0);
40 set_state(PART:"icon_clip", "disabled", 0.0); 56 set_state(PART:"icon_clip", "disabled", 0.0);
41 set_state(PART:"event", "disabled", 0.0); 57 set_state(PART:"event", "disabled", 0.0);
58 set_state(PART:"base", "disabled", 0.0);
42 } 59 }
43 } else if (m1 == (LABEL)) { 60 } else if (m1 == (LABEL)) {
44 if (!d) { 61 if (!d) {
45 set_state(PART:"elm.swallow.content", "default", 0.0); 62 set_state(PART:"elm.swallow.content", "default", 0.0);
46 set_state(PART:"sizer.content", "default", 0.0); 63 set_state(PART:"sizer.content", "default", 0.0);
47 set_state(PART:"elm.text", "textonly", 0.0);
48 set_state(PART:"icon_clip", "default", 0.0); 64 set_state(PART:"icon_clip", "default", 0.0);
49 set_state(PART:"event", "default", 0.0); 65 set_state(PART:"event", "default", 0.0);
66 if (!p) {
67 set_state(PART:"elm.text", "textonly", 0.0);
68 set_state(PART:"base", "default", 0.0);
69 } else {
70 set_state(PART:"elm.text", "pressed_textonly", 0.0);
71 set_state(PART:"base", "pressed", 0.0);
72 }
50 } else { 73 } else {
51 set_state(PART:"elm.swallow.content", "default", 0.0); 74 set_state(PART:"elm.swallow.content", "default", 0.0);
52 set_state(PART:"sizer.content", "default", 0.0); 75 set_state(PART:"sizer.content", "default", 0.0);
53 set_state(PART:"elm.text", "disabled_textonly", 0.0); 76 set_state(PART:"elm.text", "disabled_textonly", 0.0);
54 set_state(PART:"icon_clip", "disabled", 0.0); 77 set_state(PART:"icon_clip", "disabled", 0.0);
55 set_state(PART:"event", "disabled", 0.0); 78 set_state(PART:"event", "disabled", 0.0);
79 set_state(PART:"base", "disabled", 0.0);
56 } 80 }
57 } else { 81 } else {
58 if (!d) { 82 if (!d) {
@@ -61,12 +85,18 @@ group { name: "elm/button/base/default";
61 set_state(PART:"elm.text", "icononly", 0.0); 85 set_state(PART:"elm.text", "icononly", 0.0);
62 set_state(PART:"icon_clip", "default", 0.0); 86 set_state(PART:"icon_clip", "default", 0.0);
63 set_state(PART:"event", "default", 0.0); 87 set_state(PART:"event", "default", 0.0);
88 if (!p) {
89 set_state(PART:"base", "default", 0.0);
90 } else {
91 set_state(PART:"base", "pressed", 0.0);
92 }
64 } else { 93 } else {
65 set_state(PART:"elm.swallow.content", "default", 0.0); 94 set_state(PART:"elm.swallow.content", "default", 0.0);
66 set_state(PART:"sizer.content", "default", 0.0); 95 set_state(PART:"sizer.content", "default", 0.0);
67 set_state(PART:"elm.text", "icononly", 0.0); 96 set_state(PART:"elm.text", "icononly", 0.0);
68 set_state(PART:"icon_clip", "disabled", 0.0); 97 set_state(PART:"icon_clip", "disabled", 0.0);
69 set_state(PART:"event", "disabled", 0.0); 98 set_state(PART:"event", "disabled", 0.0);
99 set_state(PART:"base", "disabled", 0.0);
70 } 100 }
71 } 101 }
72 } 102 }
@@ -80,19 +110,30 @@ group { name: "elm/button/base/default";
80 rel1.offset: -1 0; 110 rel1.offset: -1 0;
81 rel2.offset: 0 1; 111 rel2.offset: 0 1;
82 fill.smooth: 0; 112 fill.smooth: 0;
113 color_class: "button_bg";
83 } 114 }
84 desc { "clicked"; 115 desc { "pressed";
85 inherit: "default"; 116 inherit: "default";
86 image.normal: "button_clicked.png"; 117 image.normal: "button_clicked.png";
87 image.border: 5 5 4 6; 118 image.border: 5 5 4 6;
119 color_class: "button_bg_pressed";
120 }
121 desc { "disabled";
122 inherit: "default";
123 color_class: "button_bg_disabled";
88 } 124 }
89 } 125 }
90 rect { "icon_clip"; 126 rect { "icon_clip";
91 desc { "default"; 127 desc { "default";
128 color_class: "button_icon";
129 }
130 desc { "pressed";
131 inherit: "default";
132 color_class: "button_icon_pressed";
92 } 133 }
93 desc { "disabled"; 134 desc { "disabled";
94 inherit: "default"; 135 inherit: "default";
95 color: 255 255 255 64; 136 color_class: "button_icon_disabled";
96 } 137 }
97 } 138 }
98 swallow { "elm.swallow.content"; nomouse; 139 swallow { "elm.swallow.content"; nomouse;
@@ -181,6 +222,15 @@ group { name: "elm/button/base/default";
181 visible: 1; 222 visible: 1;
182 fixed: 0 0; 223 fixed: 0 0;
183 } 224 }
225 desc { "pressed_visible";
226 inherit: "default";
227 rel1.offset: 2 5;
228 text.min: 1 1;
229 text.ellipsis: -1;
230 visible: 1;
231 fixed: 0 0;
232 color_class: "button_text_pressed";
233 }
184 desc { "textonly"; 234 desc { "textonly";
185 inherit: "default"; 235 inherit: "default";
186 text.min: 1 1; 236 text.min: 1 1;
@@ -188,6 +238,14 @@ group { name: "elm/button/base/default";
188 visible: 1; 238 visible: 1;
189 fixed: 0 0; 239 fixed: 0 0;
190 } 240 }
241 desc { "pressed_textonly";
242 inherit: "default";
243 text.min: 1 1;
244 text.ellipsis: -1;
245 visible: 1;
246 fixed: 0 0;
247 color_class: "button_text_pressed";
248 }
191 desc { "disabled_visible"; 249 desc { "disabled_visible";
192 inherit: "default"; 250 inherit: "default";
193 rel1.offset: 2 5; 251 rel1.offset: 2 5;
@@ -225,8 +283,11 @@ group { name: "elm/button/base/default";
225 after: "button_click_anim"; 283 after: "button_click_anim";
226 } 284 }
227 program { name: "button_click_anim"; 285 program { name: "button_click_anim";
228 action: STATE_SET "clicked" 0.0; 286 script {
229 target: "base"; 287 new m = get_int(btmode);
288 m |= PRESSED; set_int(btmode, m);
289 eval_mode(m);
290 }
230 } 291 }
231 program { name: "button_unclick"; 292 program { name: "button_unclick";
232 signal: "mouse,up,1"; source: "event"; 293 signal: "mouse,up,1"; source: "event";
@@ -234,12 +295,15 @@ group { name: "elm/button/base/default";
234 after: "button_unclick_anim"; 295 after: "button_unclick_anim";
235 } 296 }
236 program { name: "button_unclick_anim"; 297 program { name: "button_unclick_anim";
237 action: STATE_SET "default" 0.0; 298 script {
238 target: "base"; 299 new m = get_int(btmode);
300 m &= ~PRESSED; set_int(btmode, m);
301 eval_mode(m);
302 }
239 } 303 }
240 program { name: "buttonactivate"; 304 program { name: "buttonactivate";
241 signal: "elm,anim,activate"; source: "elm"; 305 signal: "elm,anim,activate"; source: "elm";
242 action: STATE_SET "clicked" 0.0; 306 action: STATE_SET "pressed" 0.0;
243 target: "base"; 307 target: "base";
244 after: "button_unpressed_anim"; 308 after: "button_unpressed_anim";
245 } 309 }
@@ -306,6 +370,7 @@ group { name: "elm/button/base/default";
306#undef LABEL 370#undef LABEL
307#undef MASK 371#undef MASK
308#undef DISABLE 372#undef DISABLE
373#undef PRESSED
309} 374}
310 375
311group { name: "elm/button/base/anchor"; 376group { name: "elm/button/base/anchor";
@@ -882,7 +947,7 @@ group { name: "elm/button/base/hoversel_vertical/default";
882 image.border: 7 7 7 7; 947 image.border: 7 7 7 7;
883 fill.smooth : 0; 948 fill.smooth : 0;
884 } 949 }
885 desc { "clicked"; 950 desc { "pressed";
886 inherit: "default"; 951 inherit: "default";
887 rel1.offset: 0 -2; 952 rel1.offset: 0 -2;
888 rel2.offset: 0 -1; 953 rel2.offset: 0 -1;
@@ -891,9 +956,13 @@ group { name: "elm/button/base/hoversel_vertical/default";
891 } 956 }
892 programs { 957 programs {
893 program { name: "button_click_anim"; 958 program { name: "button_click_anim";
959 action: STATE_SET "pressed" 0.0;
960 target: "base";
894 target: "select_line"; 961 target: "select_line";
895 } 962 }
896 program { name: "button_unclick_anim"; 963 program { name: "button_unclick_anim";
964 action: STATE_SET "default" 0.0;
965 target: "base";
897 target: "select_line"; 966 target: "select_line";
898 } 967 }
899 program { name: "buttonactivate"; 968 program { name: "buttonactivate";