summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwoochan lee <wc0917.lee@samsung.com>2016-01-04 14:55:04 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-04 14:55:54 -0800
commit4e3e6b8f02d677846aec4106a9fafea61b499f89 (patch)
treea402c8a41994eb30bf9bd5e9c47406f1d0a426c2
parent7db06cb64aa691bb85bd604de6c5928cf442b737 (diff)
multibuttonentry: add color classes and text classes.
Summary: The following new color classes and text classes for multibuttonentry widget are added. "multibuttonentry_bg", "Multibuttonentry Background" "multibuttonentry_item_bg", "Multibuttonentry Item Background" "multibuttonentry_item_bg_selected", "Multibuttonentry Item Selected Background" "multibuttonentry_item_text", "Multibuttonentry Item Text" "multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text" "multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text" @feature Reviewers: raster, cedric, Hermet, kimcinoo, woohyun Subscribers: SanghyeonLee, eagleeye, id213sin Differential Revision: https://phab.enlightenment.org/D3494 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--data/themes/colorclasses.edc24
-rw-r--r--data/themes/edc/elm/multibuttonentry.edc84
-rw-r--r--src/lib/elm_config.c9
3 files changed, 105 insertions, 12 deletions
diff --git a/data/themes/colorclasses.edc b/data/themes/colorclasses.edc
index a67d4450b..5d92ec1d5 100644
--- a/data/themes/colorclasses.edc
+++ b/data/themes/colorclasses.edc
@@ -324,6 +324,30 @@ color_classes {
324 color: 255 255 255 255; 324 color: 255 255 255 255;
325 desc: "Color of ctxpopup background"; 325 desc: "Color of ctxpopup background";
326 } 326 }
327 color_class { name: "multibuttonentry_bg";
328 color: 0 0 0 0;
329 desc: "Background of a multibuttonentry widget";
330 }
331 color_class { name: "multibuttonentry_item_bg";
332 color: 0 0 0 0;
333 desc: "Background of a multibuttonentry item object";
334 }
335 color_class { name: "multibuttonentry_item_bg_selected";
336 color: 0 0 0 0;
337 desc: "Background of a selected multibuttonentry item object";
338 }
339 color_class { name: "multibuttonentry_item_text";
340 color: FN_COL_DEFAULT;
341 desc: "Text of a multibuttonentry item";
342 }
343 color_class { name: "multibuttonentry_item_text_pressed";
344 color: FN_COL_HIGHLIGHT;
345 desc: "Text of a pressed multibuttonentry item";
346 }
347 color_class { name: "multibuttonentry_item_text_disabled";
348 color: FN_COL_DISABLE;
349 desc: "Text of a disabled multibuttonentry item";
350 }
327 351
328// modules 352// modules
329 color_class { name: "module_label"; 353 color_class { name: "module_label";
diff --git a/data/themes/edc/elm/multibuttonentry.edc b/data/themes/edc/elm/multibuttonentry.edc
index 35eddcadf..0cca89713 100644
--- a/data/themes/edc/elm/multibuttonentry.edc
+++ b/data/themes/edc/elm/multibuttonentry.edc
@@ -7,7 +7,7 @@ group { name: "elm/multibuttonentry/base/default";
7 type: RECT; 7 type: RECT;
8 scale: 1; 8 scale: 1;
9 description { state: "default" 0.0; 9 description { state: "default" 0.0;
10 color: 0 0 0 0; 10 color_class: "multibuttonentry_bg";
11 } 11 }
12 } 12 }
13 part { name: "box.swallow"; type: SWALLOW; 13 part { name: "box.swallow"; type: SWALLOW;
@@ -74,7 +74,20 @@ group { name: "elm/multibuttonentry/btn/default";
74 tag: "tab" "\t"; 74 tag: "tab" "\t";
75 } 75 }
76 } 76 }
77
78 script {
79 public disabled = 0;
80 }
81
77 parts { 82 parts {
83 part { name: "bg"; type: RECT;
84 description { state: "default" 0.0;
85 color_class: "multibuttonentry_item_bg";
86 }
87 description { state: "pressed" 0.0;
88 color_class: "multibuttonentry_item_bg_selected";
89 }
90 }
78 part { name: "base"; 91 part { name: "base";
79 description { state: "default" 0.0; 92 description { state: "default" 0.0;
80 image.normal: "button_normal.png"; 93 image.normal: "button_normal.png";
@@ -84,7 +97,7 @@ group { name: "elm/multibuttonentry/btn/default";
84 rel2.offset: 0 1; 97 rel2.offset: 0 1;
85 fill.smooth: 0; 98 fill.smooth: 0;
86 } 99 }
87 description { state: "clicked" 0.0; 100 description { state: "pressed" 0.0;
88 inherit: "default" 0.0; 101 inherit: "default" 0.0;
89 image.normal: "button_clicked.png"; 102 image.normal: "button_clicked.png";
90 image.border: 5 5 4 6; 103 image.border: 5 5 4 6;
@@ -141,12 +154,12 @@ group { name: "elm/multibuttonentry/btn/default";
141 part { name: "elm.btn.text"; type: TEXTBLOCK; mouse_events: 0; 154 part { name: "elm.btn.text"; type: TEXTBLOCK; mouse_events: 0;
142 scale: 1; 155 scale: 1;
143 description { state: "default" 0.0; 156 description { state: "default" 0.0;
144 color_class: "multibuttonentry_label"; 157 color_class: "multibuttonentry_item_text";
145 text { style: "multibuttonentry_textblock_style"; 158 text { style: "multibuttonentry_textblock_style";
146 min: 1 1; 159 min: 1 1;
147 ellipsis: -1; 160 ellipsis: -1;
148 text_class: "multibuttonentry_label"; 161 text_class: "multibuttonentry_item_text";
149 } 162 }
150 visible: 0; 163 visible: 0;
151 rel1.offset: 5 5; 164 rel1.offset: 5 5;
152 rel1.to: "base"; 165 rel1.to: "base";
@@ -159,12 +172,12 @@ group { name: "elm/multibuttonentry/btn/default";
159 part { name: "text"; type: TEXTBLOCK; mouse_events: 0; 172 part { name: "text"; type: TEXTBLOCK; mouse_events: 0;
160 scale: 1; 173 scale: 1;
161 description { state: "default" 0.0; 174 description { state: "default" 0.0;
162 color_class: "multibuttonentry_label"; 175 color_class: "multibuttonentry_item_text";
163 text { style: "multibuttonentry_textblock_style"; 176 text { style: "multibuttonentry_textblock_style";
164 text_source: "elm.btn.text"; 177 text_source: "elm.btn.text";
165 min: 0 1; 178 min: 0 1;
166 align: 0.0 0.5; 179 align: 0.0 0.5;
167 text_class: "multibuttonentry_label"; 180 text_class: "multibuttonentry_item_text";
168 } 181 }
169 align: 0.0 0.5; 182 align: 0.0 0.5;
170 rel1.offset: 5 5; 183 rel1.offset: 5 5;
@@ -174,12 +187,30 @@ group { name: "elm/multibuttonentry/btn/default";
174 rel2.relative: 0.0 1.0; 187 rel2.relative: 0.0 1.0;
175 rel2.offset: -3 -7; 188 rel2.offset: -3 -7;
176 } 189 }
190 description { state: "pressed" 0.0;
191 inherit: "default";
192 color_class: "multibuttonentry_item_text_pressed";
193 text {
194 text_class: "multibuttonentry_item_text_pressed";
195 }
196 }
197 description { state: "disabled" 0.0;
198 inherit: "default";
199 color_class: "multibuttonentry_item_text_disabled";
200 text {
201 text_class: "multibuttonentry_item_text_disabled";
202 }
203 }
177 } 204 }
178 } 205 }
179 programs { 206 programs {
180 program { 207 program {
181 signal: "mouse,clicked,1"; source: "base"; 208 signal: "mouse,clicked,1"; source: "base";
182 action: SIGNAL_EMIT "clicked" "elm"; 209 script {
210 if (get_int(disabled) == 0) {
211 emit("clicked", "");
212 }
213 }
183 } 214 }
184 program { 215 program {
185 signal: "elm,state,default"; source: "elm"; 216 signal: "elm,state,default"; source: "elm";
@@ -192,14 +223,43 @@ group { name: "elm/multibuttonentry/btn/default";
192 target: "glow"; 223 target: "glow";
193 } 224 }
194 program { 225 program {
226 signal: "elm,state,enabled"; source: "elm";
227 script {
228 set_state(PART:"text", "default", 0.0);
229 set_int(disabled , 0);
230 }
231 }
232 program {
233 signal: "elm,state,disabled"; source: "elm";
234 script {
235 new st[31];
236 new Float: vl;
237 get_state(PART:"glow", st, 30, vl);
238 if (!strcmp(st, "focused"))
239 set_state(PART:"glow", "default", 0.0);
240 set_state(PART:"text", "disabled", 0.0);
241 set_int(disabled , 1);
242 }
243 }
244 program {
195 signal: "mouse,down,1"; source: "base"; 245 signal: "mouse,down,1"; source: "base";
196 action: STATE_SET "clicked" 0.0; 246 script {
197 target: "base"; 247 if (get_int(disabled) == 0) {
248 set_state(PART:"base", "pressed", 0.0);
249 set_state(PART:"bg", "pressed", 0.0);
250 set_state(PART:"text", "pressed", 0.0);
251 }
252 }
198 } 253 }
199 program { 254 program {
200 signal: "mouse,up,1"; source: "base"; 255 signal: "mouse,up,1"; source: "base";
201 action: STATE_SET "default" 0.0; 256 script {
202 target: "base"; 257 if (get_int(disabled) == 0) {
258 set_state(PART:"base", "default", 0.0);
259 set_state(PART:"bg", "default", 0.0);
260 set_state(PART:"text", "default", 0.0);
261 }
262 }
203 } 263 }
204 program { 264 program {
205 signal: "mouse,clicked,1"; source: "del"; 265 signal: "mouse,clicked,1"; source: "del";
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 991ecd2c5..3496c6cf5 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -74,6 +74,9 @@ static const Elm_Text_Class _elm_text_classes[] = {
74 {"index_highlight_text," "Index Highlight Text"}, 74 {"index_highlight_text," "Index Highlight Text"},
75 {"index_item_text," "Index Items Text"}, 75 {"index_item_text," "Index Items Text"},
76 {"index_item_text_selected," "Index Selected Items Text"}, 76 {"index_item_text_selected," "Index Selected Items Text"},
77 {"multibuttonentry_item_text", "Multibuttonentry Items"},
78 {"multibuttonentry_item_text_pressed", "Multibuttonentry Pressed Items"},
79 {"multibuttonentry_item_text_disabled", "Multibuttonentry Disabled Items"},
77 {"title_bar", "Title Bar"}, 80 {"title_bar", "Title Bar"},
78 {"list_item", "List Items"}, 81 {"list_item", "List Items"},
79 {"grid_item", "Grid Items"}, 82 {"grid_item", "Grid Items"},
@@ -142,6 +145,12 @@ static const Elm_Color_Class _elm_color_classes[] = {
142 {"bubble_info", "Bubble Info Text"}, 145 {"bubble_info", "Bubble Info Text"},
143 {"menu_item_active", "Menu Item Text"}, 146 {"menu_item_active", "Menu Item Text"},
144 {"menu_item_disabled", "Menu Item Disabled Text"}, 147 {"menu_item_disabled", "Menu Item Disabled Text"},
148 {"multibuttonentry_bg", "Multibuttonentry Background"},
149 {"multibuttonentry_item_bg", "Multibuttonentry Item Background"},
150 {"multibuttonentry_item_bg_selected", "Multibuttonentry Item Selected Background"},
151 {"multibuttonentry_item_text", "Multibuttonentry Item Text"},
152 {"multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text"},
153 {"multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text"},
145 {"border_title", "Border Title Text"}, 154 {"border_title", "Border Title Text"},
146 {"border_title_active", "Border Title Active Text"}, 155 {"border_title_active", "Border Title Active Text"},
147 {"datetime_text", "Datetime Text"}, 156 {"datetime_text", "Datetime Text"},