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 42 42
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
45 ////////////////////////////////////////////////////////////////////////////////
46 #define CHECK_STYLE_GRID(style_name, image_grid, width, height) \
47 group { name: "elm/check/base/"style_name; \
48 images.image: image_grid COMP; \
53 description { state: "default" 0.0; \
56 description { state: "pressed" 0.0; \
57 inherit: "default" 0.0; \
59 description { state: "disabled" 0.0; \
60 inherit: "default" 0.0; \
64 part { name: "icon_bg_img"; \
70 rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } \
71 rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } \
74 part { name: "icon_bg"; \
76 description { state: "default" 0.0; \
78 rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } \
79 rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } \
86 description { state: "default" 0.0; \
94 description { state: "pressed" 0.0; \
95 inherit: "default" 0.0; \
97 description { state: "disabled" 0.0; \
98 inherit: "default" 0.0; \
102 part { name: "selected_bg"; \
105 description { state: "default" 0.0; \
106 rel1.to: "icon_bg"; \
107 rel2.to: "icon_bg"; \
111 description { state: "visible" 0.0; \
112 inherit: "default" 0.0; \
117 part { name: "check"; \
120 description { state: "default" 0.0; \
124 image.normal: image_grid; \
126 description { state: "visible" 0.0; \
127 inherit: "default" 0.0; \
130 description { state: "pressed" 0.0; \
131 inherit: "default" 0.0; \
134 description { state: "disabled_visible" 0.0; \
135 inherit: "default" 0.0; \
139 part { name: "elm.swallow.content"; \
142 state: "default" 0.0; \
145 color: 255 255 255 255; \
158 description { state: "visible" 0.0; \
159 inherit: "default" 0.0; \
163 aspect_preference: VERTICAL; \
165 description { state: "disabled" 0.0; \
166 inherit: "default" 0.0; \
167 color: 128 128 128 128; \
169 description { state: "disabled_visible" 0.0; \
170 inherit: "default" 0.0; \
171 color: 128 128 128 128; \
177 part { name: "elm.text"; \
181 description { state: "default" 0.0; \
187 to_x: "elm.swallow.content"; \
193 color: 255 255 255 255; \
196 style: "check_label_textblock_style"; \
199 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
201 description { state: "visible" 0.0; \
202 inherit: "default" 0.0; \
206 description { state: "disabled" 0.0; \
207 inherit: "default" 0.0; \
209 description { state: "disabled_visible" 0.0; \
210 inherit: "default" 0.0; \
213 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
216 part { name: "events"; \
218 ignore_flags: ON_HOLD; \
219 description { state: "default" 0.0; \
223 part { name: "disabler"; \
225 description { state: "default" 0.0; \
229 description { state: "disabled" 0.0; \
230 inherit: "default" 0.0; \
236 program { name: "click"; \
237 signal: "mouse,up,1"; \
239 action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
240 after: "bg_normal"; \
242 program { name: "bg_normal"; \
244 set_state(PART:"bg", "default", 0.0); \
245 set_state(PART:"bg2", "default", 0.0); \
248 program { name: "mouseout"; \
249 signal: "mouse,out"; \
251 after: "bg_check_normal"; \
253 program { name: "bg_check_normal"; \
257 get_state(PART:"check", st, 30, vl); \
258 if (!strcmp(st, "pressed")) \
259 set_state(PART:"check", "visible", 0.0); \
260 set_state(PART:"bg", "default", 0.0); \
261 set_state(PART:"bg2", "default", 0.0); \
264 program { name: "pressed"; \
265 signal: "mouse,down,1"; \
270 get_state(PART:"check", st, 30, vl); \
271 if (!strcmp(st, "visible")) \
272 set_state(PART:"check", "pressed", 0.0); \
273 set_state(PART:"bg", "pressed", 0.0); \
274 set_state(PART:"bg2", "pressed", 0.0); \
277 program { name: "check_on"; \
278 signal: "elm,state,check,on"; \
280 action: STATE_SET "visible" 0.0; \
282 target: "selected_bg"; \
284 program { name: "check_off"; \
285 signal: "elm,state,check,off"; \
287 action: STATE_SET "default" 0.0; \
289 target: "selected_bg"; \
291 program { name: "text_show"; \
292 signal: "elm,state,text,visible"; \
294 action: STATE_SET "visible" 0.0; \
295 target: "elm.text"; \
297 program { name: "text_hide"; \
298 signal: "elm,state,text,hidden"; \
300 action: STATE_SET "default" 0.0; \
301 target: "elm.text"; \
303 program { name: "icon_show"; \
304 signal: "elm,state,icon,visible"; \
306 action: STATE_SET "visible" 0.0; \
307 target: "elm.swallow.content"; \
309 program { name: "icon_hide"; \
310 signal: "elm,state,icon,hidden"; \
312 action: STATE_SET "default" 0.0; \
313 target: "elm.swallow.content"; \
315 program { name: "disable"; \
316 signal: "elm,state,disabled"; \
318 action: STATE_SET "disabled" 0.0; \
319 target: "disabler"; \
322 after: "disable_text"; \
324 program { name: "disable_text"; \
328 get_state(PART:"elm.text", st, 30, vl); \
329 if (!strcmp(st, "visible")) \
330 set_state(PART:"elm.text", "disabled_visible", 0.0); \
332 set_state(PART:"elm.text", "disabled", 0.0); \
333 get_state(PART:"elm.swallow.content", st, 30, vl); \
334 if (!strcmp(st, "visible")) \
335 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
337 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
338 get_state(PART:"check", st, 30, vl); \
339 if (!strcmp(st, "visible")) \
340 set_state(PART:"check", "disabled_visible", 0.0); \
343 program { name: "enable"; \
344 signal: "elm,state,enabled"; \
346 action: STATE_SET "default" 0.0; \
347 target: "disabler"; \
350 after: "enable_text"; \
352 program { name: "enable_text"; \
356 get_state(PART:"elm.text", st, 30, vl); \
357 if (!strcmp(st, "disabled_visible")) \
358 set_state(PART:"elm.text", "visible", 0.0); \
360 set_state(PART:"elm.text", "default", 0.0); \
361 get_state(PART:"elm.swallow.content", st, 30, vl); \
362 if (!strcmp(st, "visible")) \
363 set_state(PART:"elm.swallow.content", "visible", 0.0); \
365 set_state(PART:"elm.swallow.content", "default", 0.0); \
366 get_state(PART:"check", st, 30, vl); \
367 if (!strcmp(st, "disabled_visible")) \
368 set_state(PART:"check", "visible", 0.0); \
374 ////////////////////////////////////////////////////////////////////////////////
375 CHECK_STYLE_GRID("gallery_efl/grid", GE_EDC_IMAGE_CHECK_GRID, 64, 64)
378 #undef CHECK_STATE_DEFAULT
379 #undef CHECK_STATE_VISIBLE
380 #undef CHECK_STATE_DISABLED_VISIBLE
381 #undef CHECK_STATE_DISABLED