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_select.png" COMP; \
42 image: "00_button_radio_dim.png" COMP; \
43 image: "00_button_radio.png" COMP; \
44 image: "00_button_radio_press.png" COMP; \
45 image: "00_button_radio_select_dim.png" COMP; \
48 part { name: "back_bg"; \
51 description { state: "default" 0.0; \
52 rel2.relative: 0.0 1.0; \
54 min: min_width min_height; \
62 description { state: "default" 0.0; \
63 min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
64 max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
68 image.normal: "00_button_radio.png"; \
70 description { state: "disabled" 0.0; \
71 inherit: "default" 0.0; \
72 image.normal: "00_button_radio_dim.png"; \
74 description { state: "pressed" 0.0; \
75 inherit: "default" 0.0; \
76 image.normal: "00_button_radio_press.png"; \
79 part { name: "radio"; \
80 clip_to: "opacity_clip"; \
83 description { state: "default" 0.0; \
87 image.normal: "00_button_radio_select.png"; \
90 description { state: "visible" 0.0; \
91 inherit: "default" 0.0; \
93 max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
95 description { state: "disabled" 0.0; \
96 inherit: "default" 0.0; \
98 description { state: "disabled_visible" 0.0; \
99 inherit: "visible" 0.0; \
100 image.normal: "00_button_radio_select_dim.png"; \
103 part { name: "opacity_clip"; \
106 description { state: "default" 0.0; \
107 color: 255 255 255 0; \
109 description { state: "visible" 0.0; \
110 inherit: "default" 0.0; \
111 color: 255 255 255 255; \
114 part { name: "elm.swallow.content"; \
116 clip_to: "disclip"; \
117 description { state: "default" 0.0; \
131 description { state: "visible" 0.0; \
132 inherit: "default" 0.0; \
136 aspect_preference: VERTICAL; \
138 description { state: "disabled" 0.0; \
139 inherit: "default" 0.0; \
141 description { state: "disabled_visible" 0.0; \
142 inherit: "default" 0.0; \
148 part { name: "elm.text"; \
151 clip_to: "disclip"; \
153 description { state: "default" 0.0; \
159 to_x: "elm.swallow.content"; \
167 style: "radio_label_textblock_style"; \
170 color: RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC; \
172 description { state: "visible" 0.0; \
173 inherit: "default" 0.0; \
177 description { state: "disabled" 0.0; \
178 inherit: "default" 0.0; \
180 description { state: "disabled_visible" 0.0; \
181 inherit: "default" 0.0; \
184 color: RADIO_DEFAULT_TEXT_DISABLED_COLOR_INC; \
187 part { name: "over1"; \
189 ignore_flags: ON_HOLD; \
190 description { state: "default" 0.0; \
194 part { name: "over2"; \
197 description { state: "default" 0.0; \
201 part { name: "disclip"; \
204 description { state: "default" 0.0; \
205 color: RADIO_DISCLIP_NORMAL_COLOR_INC; \
207 description { state: "disabled" 0.0; \
208 color: RADIO_DISCLIP_DISABLED_COLOR_INC; \
211 part { name: "disabler"; \
213 description { state: "default" 0.0; \
216 description { state: "disabled" 0.0; \
217 inherit: "default" 0.0; \
224 program { name: "click"; \
225 signal: "mouse,clicked,1"; \
227 action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
229 program { name: "bg_normal"; \
230 signal: "mouse,up,1"; \
232 action: STATE_SET "default" 0.0; \
235 program { name: "pressed"; \
236 signal: "mouse,down,1"; \
238 action: STATE_SET "pressed" 0.0; \
241 program { name: "radio_on"; \
242 signal: "elm,state,radio,on"; \
245 run_program(PROGRAM:"radio_show_effect"); \
246 run_program(PROGRAM:"radio_draw_effect"); \
249 program { name: "radio_off"; \
250 signal: "elm,state,radio,off"; \
253 set_state(PART:"opacity_clip", "default", 0.0); \
254 set_state(PART:"radio", "default", 0.0); \
257 program { name: "radio_show_effect"; \
258 action: STATE_SET "visible" 0.0; \
259 transition: LINEAR 0.233; \
260 target: "opacity_clip"; \
262 program { name: "radio_draw_effect"; \
263 action: STATE_SET "visible" 0.0; \
264 transition: LINEAR 0.267; \
267 program { name: "text_show"; \
268 signal: "elm,state,text,visible"; \
270 action: STATE_SET "visible" 0.0; \
271 target: "elm.text"; \
273 program { name: "text_hide"; \
274 signal: "elm,state,text,hidden"; \
276 action: STATE_SET "default" 0.0; \
277 target: "elm.text"; \
279 program { name: "icon_show"; \
280 signal: "elm,state,icon,visible"; \
282 action: STATE_SET "visible" 0.0; \
283 target: "elm.swallow.content"; \
285 program { name: "icon_hide"; \
286 signal: "elm,state,icon,hidden"; \
288 action: STATE_SET "default" 0.0; \
289 target: "elm.swallow.content"; \
291 program { name: "disable"; \
292 signal: "elm,state,disabled"; \
294 action: STATE_SET "disabled" 0.0; \
297 target: "disabler"; \
298 after: "disable_text"; \
300 program { name: "disable_text"; \
304 get_state(PART:"elm.text", st, 30, vl); \
305 if (!strcmp(st, "visible")) \
306 set_state(PART:"elm.text", "disabled_visible", 0.0); \
308 set_state(PART:"elm.text", "disabled", 0.0); \
309 get_state(PART:"elm.swallow.content", st, 30, vl); \
310 if (!strcmp(st, "visible")) \
311 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
313 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
314 get_state(PART:"radio", st, 30, vl); \
315 if (!strcmp(st, "visible")) \
316 set_state(PART:"radio", "disabled_visible", 0.0); \
318 set_state(PART:"radio", "disabled", 0.0); \
321 program { name: "enable"; \
322 signal: "elm,state,enabled"; \
324 action: STATE_SET "default" 0.0; \
325 target: "disabler"; \
328 after: "enable_text"; \
330 program { name: "enable_text"; \
334 get_state(PART:"elm.text", st, 30, vl); \
335 if (!strcmp(st, "disabled_visible")) \
336 set_state(PART:"elm.text", "visible", 0.0); \
338 set_state(PART:"elm.text", "default", 0.0); \
339 get_state(PART:"elm.swallow.content", st, 30, vl); \
340 if (!strcmp(st, "disabled_visible")) \
341 set_state(PART:"elm.swallow.content", "visible", 0.0); \
343 set_state(PART:"elm.swallow.content", "default", 0.0); \
344 get_state(PART:"radio", st, 30, vl); \
345 if (!strcmp(st, "disabled_visible")) \
347 set_state(PART:"opacity_clip", "visible", 0.0); \
348 set_state(PART:"radio", "visible", 0.0); \
352 set_state(PART:"opacity_clip", "default", 0.0); \
353 set_state(PART:"radio", "default", 0.0); \
360 ///////////////////////////////////////////////////////////////////////////////////////
361 RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
363 ///////////////////////////////////////////////////////////////////////////////////////
364 RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC)
366 ///////////////////////////////////////////////////////////////////////////////////////
368 #undef RADIO_STATE_DEFAULT
369 #undef RADIO_STATE_VISIBLE
370 #undef RADIO_STATE_DISABLED_VISIBLE
371 #undef RADIO_STATE_DISABLED