2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 60 60
19 #define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255
20 #define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255
21 #define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136
23 ////////////////////////////////////////////////////////////////////////////////////////
25 // check default textblock style
27 ///////////////////////////////////////////////////////////////////////////////////////
29 style { name: "check_label_textblock_style";
30 base: "font=SLP:style=Roman text_class=slp_roman font_size=32 color=#ffffff wrap=char";
33 tag: "hilight" "+ font=SLP:style=Bold text_class=slp_bold";
34 tag: "b" "+ font=SLP:style=Bold text_class=slp_bold";
35 tag: "whitecolor" "+ color=#ffffff";
40 #define CHECK_STATE_DEFAULT 0
41 #define CHECK_STATE_VISIBLE 1
42 #define CHECK_STATE_DISABLED_VISIBLE 2
43 #define CHECK_STATE_DISABLED 3
46 ////////////////////////////////////////////////////////////////////////////////
47 #define CHECK_STYLE_GRID(style_name, image_grid, width, height) \
48 group { name: "elm/check/base/"style_name; \
49 images.image: image_grid COMP; \
54 description { state: "default" 0.0; \
57 description { state: "pressed" 0.0; \
58 inherit: "default" 0.0; \
60 description { state: "disabled" 0.0; \
61 inherit: "default" 0.0; \
65 part { name: "icon_bg_img"; \
71 rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } \
72 rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } \
75 part { name: "icon_bg"; \
77 description { state: "default" 0.0; \
79 rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } \
80 rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } \
87 description { state: "default" 0.0; \
95 description { state: "pressed" 0.0; \
96 inherit: "default" 0.0; \
98 description { state: "disabled" 0.0; \
99 inherit: "default" 0.0; \
103 part { name: "selected_bg"; \
106 description { state: "default" 0.0; \
107 rel1.to: "icon_bg"; \
108 rel2.to: "icon_bg"; \
112 description { state: "visible" 0.0; \
113 inherit: "default" 0.0; \
118 part { name: "check"; \
121 description { state: "default" 0.0; \
125 image.normal: image_grid; \
127 description { state: "visible" 0.0; \
128 inherit: "default" 0.0; \
131 description { state: "pressed" 0.0; \
132 inherit: "default" 0.0; \
135 description { state: "disabled_visible" 0.0; \
136 inherit: "default" 0.0; \
140 part { name: "elm.swallow.content"; \
143 state: "default" 0.0; \
146 color: 255 255 255 255; \
159 description { state: "visible" 0.0; \
160 inherit: "default" 0.0; \
164 aspect_preference: VERTICAL; \
166 description { state: "disabled" 0.0; \
167 inherit: "default" 0.0; \
168 color: 128 128 128 128; \
170 description { state: "disabled_visible" 0.0; \
171 inherit: "default" 0.0; \
172 color: 128 128 128 128; \
178 part { name: "elm.text"; \
182 description { state: "default" 0.0; \
188 to_x: "elm.swallow.content"; \
194 color: 255 255 255 255; \
197 style: "check_label_textblock_style"; \
200 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
202 description { state: "visible" 0.0; \
203 inherit: "default" 0.0; \
207 description { state: "disabled" 0.0; \
208 inherit: "default" 0.0; \
210 description { state: "disabled_visible" 0.0; \
211 inherit: "default" 0.0; \
214 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
217 part { name: "events"; \
219 ignore_flags: ON_HOLD; \
220 description { state: "default" 0.0; \
224 part { name: "disabler"; \
226 description { state: "default" 0.0; \
230 description { state: "disabled" 0.0; \
231 inherit: "default" 0.0; \
237 program { name: "click"; \
238 signal: "mouse,up,1"; \
240 action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
241 after: "bg_normal"; \
243 program { name: "bg_normal"; \
245 set_state(PART:"bg", "default", 0.0); \
246 set_state(PART:"bg2", "default", 0.0); \
249 program { name: "mouseout"; \
250 signal: "mouse,out"; \
252 after: "bg_check_normal"; \
254 program { name: "bg_check_normal"; \
258 get_state(PART:"check", st, 30, vl); \
259 if (!strcmp(st, "pressed")) \
260 set_state(PART:"check", "visible", 0.0); \
261 set_state(PART:"bg", "default", 0.0); \
262 set_state(PART:"bg2", "default", 0.0); \
265 program { name: "pressed"; \
266 signal: "mouse,down,1"; \
271 get_state(PART:"check", st, 30, vl); \
272 if (!strcmp(st, "visible")) \
273 set_state(PART:"check", "pressed", 0.0); \
274 set_state(PART:"bg", "pressed", 0.0); \
275 set_state(PART:"bg2", "pressed", 0.0); \
278 program { name: "check_on"; \
279 signal: "elm,state,check,on"; \
281 action: STATE_SET "visible" 0.0; \
283 target: "selected_bg"; \
285 program { name: "check_off"; \
286 signal: "elm,state,check,off"; \
288 action: STATE_SET "default" 0.0; \
290 target: "selected_bg"; \
292 program { name: "text_show"; \
293 signal: "elm,state,text,visible"; \
295 action: STATE_SET "visible" 0.0; \
296 target: "elm.text"; \
298 program { name: "text_hide"; \
299 signal: "elm,state,text,hidden"; \
301 action: STATE_SET "default" 0.0; \
302 target: "elm.text"; \
304 program { name: "icon_show"; \
305 signal: "elm,state,icon,visible"; \
307 action: STATE_SET "visible" 0.0; \
308 target: "elm.swallow.content"; \
310 program { name: "icon_hide"; \
311 signal: "elm,state,icon,hidden"; \
313 action: STATE_SET "default" 0.0; \
314 target: "elm.swallow.content"; \
316 program { name: "disable"; \
317 signal: "elm,state,disabled"; \
319 action: STATE_SET "disabled" 0.0; \
320 target: "disabler"; \
323 after: "disable_text"; \
325 program { name: "disable_text"; \
329 get_state(PART:"elm.text", st, 30, vl); \
330 if (!strcmp(st, "visible")) \
331 set_state(PART:"elm.text", "disabled_visible", 0.0); \
333 set_state(PART:"elm.text", "disabled", 0.0); \
334 get_state(PART:"elm.swallow.content", st, 30, vl); \
335 if (!strcmp(st, "visible")) \
336 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
338 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
339 get_state(PART:"check", st, 30, vl); \
340 if (!strcmp(st, "visible")) \
341 set_state(PART:"check", "disabled_visible", 0.0); \
344 program { name: "enable"; \
345 signal: "elm,state,enabled"; \
347 action: STATE_SET "default" 0.0; \
348 target: "disabler"; \
351 after: "enable_text"; \
353 program { name: "enable_text"; \
357 get_state(PART:"elm.text", st, 30, vl); \
358 if (!strcmp(st, "disabled_visible")) \
359 set_state(PART:"elm.text", "visible", 0.0); \
361 set_state(PART:"elm.text", "default", 0.0); \
362 get_state(PART:"elm.swallow.content", st, 30, vl); \
363 if (!strcmp(st, "visible")) \
364 set_state(PART:"elm.swallow.content", "visible", 0.0); \
366 set_state(PART:"elm.swallow.content", "default", 0.0); \
367 get_state(PART:"check", st, 30, vl); \
368 if (!strcmp(st, "disabled_visible")) \
369 set_state(PART:"check", "visible", 0.0); \
375 ////////////////////////////////////////////////////////////////////////////////
376 CHECK_STYLE_GRID("gallery/grid", GALLERY_EDC_IMAGE_CHECK_GRID, 64, 64)
378 ////////////////////////////////////////////////////////////////////////////////
379 group { name: "elm/check/base/gallery/album/grid";
384 description { state: "default" 0.0;
387 description { state: "pressed" 0.0;
388 inherit: "default" 0.0;
390 description { state: "disabled" 0.0;
391 inherit: "default" 0.0;
399 description { state: "default" 0.0;
407 description { state: "pressed" 0.0;
408 inherit: "default" 0.0;
410 description { state: "disabled" 0.0;
411 inherit: "default" 0.0;
415 part { name: "selected_bg";
418 description { state: "default" 0.0;
424 description { state: "visible" 0.0;
425 inherit: "default" 0.0;
430 part { name: "check";
434 description { state: "default" 0.0;
440 description { state: "visible" 0.0;
441 inherit: "default" 0.0;
443 description { state: "pressed" 0.0;
444 inherit: "default" 0.0;
446 description { state: "disabled_visible" 0.0;
447 inherit: "default" 0.0;
450 part { name: "elm.swallow.content";
453 state: "default" 0.0;
456 color: 255 255 255 255;
469 description { state: "visible" 0.0;
470 inherit: "default" 0.0;
474 aspect_preference: VERTICAL;
476 description { state: "disabled" 0.0;
477 inherit: "default" 0.0;
478 color: 128 128 128 128;
480 description { state: "disabled_visible" 0.0;
481 inherit: "default" 0.0;
482 color: 128 128 128 128;
488 part { name: "elm.text";
492 description { state: "default" 0.0;
498 to_x: "elm.swallow.content";
504 color: 255 255 255 255;
507 style: "check_label_textblock_style";
510 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
512 description { state: "visible" 0.0;
513 inherit: "default" 0.0;
517 description { state: "disabled" 0.0;
518 inherit: "default" 0.0;
520 description { state: "disabled_visible" 0.0;
521 inherit: "default" 0.0;
524 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
527 part { name: "events";
529 ignore_flags: ON_HOLD;
530 description { state: "default" 0.0;
534 part { name: "disabler";
536 description { state: "default" 0.0;
540 description { state: "disabled" 0.0;
541 inherit: "default" 0.0;
547 program { name: "click";
548 signal: "mouse,up,1";
550 action: SIGNAL_EMIT "elm,action,check,toggle" "";
553 program { name: "bg_normal";
555 set_state(PART:"bg", "default", 0.0);
556 set_state(PART:"bg2", "default", 0.0);
559 program { name: "mouseout";
562 after: "bg_check_normal";
564 program { name: "bg_check_normal";
568 get_state(PART:"check", st, 30, vl);
569 if (!strcmp(st, "pressed"))
570 set_state(PART:"check", "visible", 0.0);
571 set_state(PART:"bg", "default", 0.0);
572 set_state(PART:"bg2", "default", 0.0);
575 program { name: "pressed";
576 signal: "mouse,down,1";
581 get_state(PART:"check", st, 30, vl);
582 if (!strcmp(st, "visible"))
583 set_state(PART:"check", "pressed", 0.0);
584 set_state(PART:"bg", "pressed", 0.0);
585 set_state(PART:"bg2", "pressed", 0.0);
588 program { name: "check_on";
589 signal: "elm,state,check,on";
591 action: STATE_SET "visible" 0.0;
593 target: "selected_bg";
595 program { name: "check_off";
596 signal: "elm,state,check,off";
598 action: STATE_SET "default" 0.0;
600 target: "selected_bg";
602 program { name: "text_show";
603 signal: "elm,state,text,visible";
605 action: STATE_SET "visible" 0.0;
608 program { name: "text_hide";
609 signal: "elm,state,text,hidden";
611 action: STATE_SET "default" 0.0;
614 program { name: "icon_show";
615 signal: "elm,state,icon,visible";
617 action: STATE_SET "visible" 0.0;
618 target: "elm.swallow.content";
620 program { name: "icon_hide";
621 signal: "elm,state,icon,hidden";
623 action: STATE_SET "default" 0.0;
624 target: "elm.swallow.content";
626 program { name: "disable";
627 signal: "elm,state,disabled";
629 action: STATE_SET "disabled" 0.0;
633 after: "disable_text";
635 program { name: "disable_text";
639 get_state(PART:"elm.text", st, 30, vl);
640 if (!strcmp(st, "visible"))
641 set_state(PART:"elm.text", "disabled_visible", 0.0);
643 set_state(PART:"elm.text", "disabled", 0.0);
644 get_state(PART:"elm.swallow.content", st, 30, vl);
645 if (!strcmp(st, "visible"))
646 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
648 set_state(PART:"elm.swallow.content", "disabled", 0.0);
649 get_state(PART:"check", st, 30, vl);
650 if (!strcmp(st, "visible"))
651 set_state(PART:"check", "disabled_visible", 0.0);
654 program { name: "enable";
655 signal: "elm,state,enabled";
657 action: STATE_SET "default" 0.0;
661 after: "enable_text";
663 program { name: "enable_text";
667 get_state(PART:"elm.text", st, 30, vl);
668 if (!strcmp(st, "disabled_visible"))
669 set_state(PART:"elm.text", "visible", 0.0);
671 set_state(PART:"elm.text", "default", 0.0);
672 get_state(PART:"elm.swallow.content", st, 30, vl);
673 if (!strcmp(st, "visible"))
674 set_state(PART:"elm.swallow.content", "visible", 0.0);
676 set_state(PART:"elm.swallow.content", "default", 0.0);
677 get_state(PART:"check", st, 30, vl);
678 if (!strcmp(st, "disabled_visible"))
679 set_state(PART:"check", "visible", 0.0);
685 #undef CHECK_STATE_DEFAULT
686 #undef CHECK_STATE_VISIBLE
687 #undef CHECK_STATE_DISABLED_VISIBLE
688 #undef CHECK_STATE_DISABLED