3 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 #define RADIO_STATE_DEFAULT 0
21 #define RADIO_STATE_VISIBLE 1
22 #define RADIO_STATE_DISABLED_VISIBLE 2
23 #define RADIO_STATE_DISABLED 3
26 style { name: "radio_label_textblock_style";
27 base: "font=Tizen:style=Medium font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=tizen";
30 tag: "hilight" "+ font=Tizen:style=Bold";
31 tag: "b" "+ font=Tizen:style=Bold";
32 tag: "whitecolor" "+ color=#ffffff";
36 ////////////////////////////////////////////////////////////////////////////////////////
38 #define RADIO_STYLE_DEFAULT(style_name, min_width, min_height) \
39 group { name: "elm/radio/base/"style_name; \
41 image: "00_button_radio_activated_dim.png" COMP; \
42 image: "00_button_radio_activated.png" COMP; \
43 image: "00_button_radio_bg.png" COMP; \
44 image: "00_button_radio_dim_bg.png" COMP; \
45 image: "00_button_radio_press_bg.png" COMP; \
46 image: "00_button_radio_press.png" COMP; \
49 part { name: "back_bg"; \
52 description { state: "default" 0.0; \
53 rel2.relative: 0.0 1.0; \
55 min: min_width min_height; \
63 description { state: "default" 0.0; \
64 min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
65 max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
69 image.normal: "00_button_radio_bg.png"; \
71 description { state: "disabled" 0.0; \
72 inherit: "default" 0.0; \
73 image.normal: "00_button_radio_dim_bg.png"; \
75 description { state: "pressed" 0.0; \
76 inherit: "default" 0.0; \
77 image.normal: "00_button_radio_press_bg.png"; \
80 part { name: "radio"; \
81 clip_to: "opacity_clip"; \
84 description { state: "default" 0.0; \
88 image.normal: "00_button_radio_activated.png"; \
91 description { state: "visible" 0.0; \
92 inherit: "default" 0.0; \
94 max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
96 description { state: "disabled" 0.0; \
97 inherit: "default" 0.0; \
99 description { state: "disabled_visible" 0.0; \
100 inherit: "visible" 0.0; \
101 image.normal: "00_button_radio_activated_dim.png"; \
103 description { state: "pressed" 0.0; \
104 inherit: "visible" 0.0; \
105 image.normal: "00_button_radio_press.png"; \
108 part { name: "opacity_clip"; \
111 description { state: "default" 0.0; \
112 color: 255 255 255 0; \
114 description { state: "visible" 0.0; \
115 inherit: "default" 0.0; \
116 color: 255 255 255 255; \
119 part { name: "elm.swallow.content"; \
121 clip_to: "disclip"; \
122 description { state: "default" 0.0; \
136 description { state: "visible" 0.0; \
137 inherit: "default" 0.0; \
141 aspect_preference: VERTICAL; \
143 description { state: "disabled" 0.0; \
144 inherit: "default" 0.0; \
146 description { state: "disabled_visible" 0.0; \
147 inherit: "default" 0.0; \
153 part { name: "elm.text"; \
156 clip_to: "disclip"; \
158 description { state: "default" 0.0; \
164 to_x: "elm.swallow.content"; \
172 style: "radio_label_textblock_style"; \
175 color: RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC; \
177 description { state: "visible" 0.0; \
178 inherit: "default" 0.0; \
182 description { state: "disabled" 0.0; \
183 inherit: "default" 0.0; \
185 description { state: "disabled_visible" 0.0; \
186 inherit: "default" 0.0; \
189 color: RADIO_DEFAULT_TEXT_DISABLED_COLOR_INC; \
192 part { name: "over1"; \
194 ignore_flags: ON_HOLD; \
195 description { state: "default" 0.0; \
199 part { name: "over2"; \
202 description { state: "default" 0.0; \
206 part { name: "disclip"; \
209 description { state: "default" 0.0; \
210 color: RADIO_DISCLIP_NORMAL_COLOR_INC; \
212 description { state: "disabled" 0.0; \
213 color: RADIO_DISCLIP_DISABLED_COLOR_INC; \
216 part { name: "disabler"; \
218 description { state: "default" 0.0; \
221 description { state: "disabled" 0.0; \
222 inherit: "default" 0.0; \
229 program { name: "click"; \
230 signal: "mouse,clicked,1"; \
232 action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
234 program { name: "touch_sound"; \
235 signal: "mouse,clicked,1"; \
237 action: PLAY_SAMPLE "touch_sound" 1.0; \
239 program { name: "bg_normal"; \
240 signal: "mouse,up,1"; \
245 get_state(PART:"radio", st, 30, vl); \
246 if (!strcmp(st, "pressed")) \
247 set_state(PART:"radio", "visible", 0.0); \
249 set_state(PART:"radio", "default", 0.0); \
250 set_state(PART:"bg", "default", 0.0); \
253 program { name: "pressed"; \
254 signal: "mouse,down,1"; \
259 get_state(PART:"radio", st, 30, vl); \
260 if (!strcmp(st, "visible")) \
261 set_state(PART:"radio", "pressed", 0.0); \
263 set_state(PART:"radio", "default", 0.0); \
264 set_state(PART:"bg", "pressed", 0.0); \
267 program { name: "mouse,out"; \
268 signal: "mouse,out"; \
273 get_state(PART:"radio", st, 30, vl); \
274 if (!strcmp(st, "visible")) \
275 set_state(PART:"radio", "visible", 0.0); \
277 set_state(PART:"radio", "default", 0.0); \
278 set_state(PART:"bg", "default", 0.0); \
281 program { name: "radio_on"; \
282 signal: "elm,state,radio,on"; \
285 run_program(PROGRAM:"radio_show_effect"); \
286 run_program(PROGRAM:"radio_draw_effect"); \
289 program { name: "radio_off"; \
290 signal: "elm,state,radio,off"; \
293 set_state(PART:"opacity_clip", "default", 0.0); \
294 set_state(PART:"radio", "default", 0.0); \
297 program { name: "radio_show_effect"; \
298 action: STATE_SET "visible" 0.0; \
299 transition: LINEAR 0.233; \
300 target: "opacity_clip"; \
302 program { name: "radio_draw_effect"; \
303 action: STATE_SET "visible" 0.0; \
304 transition: LINEAR 0.267; \
307 program { name: "text_show"; \
308 signal: "elm,state,text,visible"; \
310 action: STATE_SET "visible" 0.0; \
311 target: "elm.text"; \
313 program { name: "text_hide"; \
314 signal: "elm,state,text,hidden"; \
316 action: STATE_SET "default" 0.0; \
317 target: "elm.text"; \
319 program { name: "icon_show"; \
320 signal: "elm,state,icon,visible"; \
322 action: STATE_SET "visible" 0.0; \
323 target: "elm.swallow.content"; \
325 program { name: "icon_hide"; \
326 signal: "elm,state,icon,hidden"; \
328 action: STATE_SET "default" 0.0; \
329 target: "elm.swallow.content"; \
331 program { name: "disable"; \
332 signal: "elm,state,disabled"; \
334 action: STATE_SET "disabled" 0.0; \
337 target: "disabler"; \
338 after: "disable_text"; \
340 program { name: "disable_text"; \
344 get_state(PART:"elm.text", st, 30, vl); \
345 if (!strcmp(st, "visible")) \
346 set_state(PART:"elm.text", "disabled_visible", 0.0); \
348 set_state(PART:"elm.text", "disabled", 0.0); \
349 get_state(PART:"elm.swallow.content", st, 30, vl); \
350 if (!strcmp(st, "visible")) \
351 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
353 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
354 get_state(PART:"radio", st, 30, vl); \
355 if (!strcmp(st, "visible")) \
356 set_state(PART:"radio", "disabled_visible", 0.0); \
358 set_state(PART:"radio", "disabled", 0.0); \
361 program { name: "enable"; \
362 signal: "elm,state,enabled"; \
364 action: STATE_SET "default" 0.0; \
365 target: "disabler"; \
368 after: "enable_text"; \
370 program { name: "enable_text"; \
374 get_state(PART:"elm.text", st, 30, vl); \
375 if (!strcmp(st, "disabled_visible")) \
376 set_state(PART:"elm.text", "visible", 0.0); \
378 set_state(PART:"elm.text", "default", 0.0); \
379 get_state(PART:"elm.swallow.content", st, 30, vl); \
380 if (!strcmp(st, "disabled_visible")) \
381 set_state(PART:"elm.swallow.content", "visible", 0.0); \
383 set_state(PART:"elm.swallow.content", "default", 0.0); \
384 get_state(PART:"radio", st, 30, vl); \
385 if (!strcmp(st, "disabled_visible")) \
387 set_state(PART:"opacity_clip", "visible", 0.0); \
388 set_state(PART:"radio", "visible", 0.0); \
392 set_state(PART:"opacity_clip", "default", 0.0); \
393 set_state(PART:"radio", "default", 0.0); \
400 ///////////////////////////////////////////////////////////////////////////////////////
401 RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
403 ///////////////////////////////////////////////////////////////////////////////////////
404 RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC)
406 ///////////////////////////////////////////////////////////////////////////////////////
408 #undef RADIO_STATE_DEFAULT
409 #undef RADIO_STATE_VISIBLE
410 #undef RADIO_STATE_DISABLED_VISIBLE
411 #undef RADIO_STATE_DISABLED