[elm_datetime] Datetime field bg is changed from RECT part to image - Dark theme...
[platform/core/uifw/efl-theme-tizen.git] / themes / widgets / radio.edc
1 /*
2  * efl-theme-tizen
3  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #define RADIO_STATE_DEFAULT 0 // radio is off
19 #define RADIO_STATE_VISIBLE 1 // radio is on
20
21    styles {
22       style { name: "radio_label_textblock_style";
23          base: "font=Tizen:style=Regular font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color="RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC" wrap=char text_class=tizen";
24          tag: "br" "\n";
25          tag: "ps" "ps";
26          tag: "hilight" "+ font=Tizen:style=Bold";
27          tag: "b" "+ font=Tizen:style=Bold";
28          tag: "whitecolor" "+ color=#ffffff";
29          tag: "tab" "\t";
30       }
31       style { name: "radio_label_textblock_style_disable";
32          base: "font=Tizen:style=Regular font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color="RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC" wrap=char text_class=tizen";
33          tag: "br" "\n";
34          tag: "ps" "ps";
35          tag: "hilight" "+ font=Tizen:style=Bold";
36          tag: "b" "+ font=Tizen:style=Bold";
37          tag: "whitecolor" "+ color=#ffffff";
38          tag: "tab" "\t";
39       }
40    }
41 ////////////////////////////////////////////////////////////////////////////////////////
42
43 #define RADIO_STYLE_DEFAULT(style_name, min_width, min_height) \
44    group { name: "elm/radio/base/"style_name; \
45       images { \
46          image: "00_button_radio_activated_dim.png" COMP; \
47          image: "00_button_radio_activated.png" COMP; \
48          image: "00_button_radio_activated_press.png" COMP; \
49          image: "00_button_radio_bg.png" COMP; \
50          image: "00_button_radio_dim_bg.png" COMP; \
51          image: "00_button_radio_press_bg.png" COMP; \
52          image: "00_button_radio_focus.png" COMP; \
53       } \
54       script { \
55          public radio_state = RADIO_STATE_DEFAULT; \
56       } \
57       parts { \
58          part { name: "back_bg"; \
59             type: RECT; \
60             scale: 1; \
61             description { state: "default" 0.0; \
62                rel2.relative: 0.0 1.0; \
63                align: 0 0.5; \
64                min: min_width min_height; \
65                fixed: 1 0; \
66                color: 0 0 0 0; \
67             } \
68          } \
69          part { name: "bg"; \
70             mouse_events: 0; \
71             scale: 1; \
72             description { state: "default" 0.0; \
73                min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
74                max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
75                fixed: 1 1; \
76                rel1.to: "back_bg"; \
77                rel2.to: "back_bg"; \
78                image.normal: "00_button_radio_bg.png"; \
79             } \
80             description { state: "disabled" 0.0; \
81                inherit: "default" 0.0; \
82                image.normal: "00_button_radio_dim_bg.png"; \
83             } \
84             description { state: "pressed" 0.0; \
85                inherit: "default" 0.0; \
86                image.normal: "00_button_radio_press_bg.png"; \
87             } \
88          } \
89          part { name: "radio"; \
90             clip_to: "opacity_clip"; \
91             mouse_events: 0; \
92             scale: 1; \
93             description { state: "default" 0.0; \
94                rel1.to: "bg"; \
95                rel2.to: "bg"; \
96                max: 0 0; \
97                image.normal: "00_button_radio_activated.png"; \
98                visible: 0; \
99             } \
100             description { state: "visible" 0.0; \
101                inherit: "default" 0.0; \
102                visible: 1; \
103                max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
104             } \
105             description { state: "disabled" 0.0; \
106                inherit: "default" 0.0; \
107             } \
108             description { state: "disabled_visible" 0.0; \
109                inherit: "visible" 0.0; \
110                image.normal: "00_button_radio_activated_dim.png"; \
111             } \
112             description { state: "pressed" 0.0; \
113                inherit: "visible" 0.0; \
114                image.normal: "00_button_radio_activated_press.png"; \
115             } \
116          } \
117          part { name: "opacity_clip"; \
118             type: RECT; \
119             mouse_events: 0; \
120             description { state: "default" 0.0; \
121                color: 255 255 255 0; \
122             } \
123             description { state: "visible" 0.0; \
124                inherit: "default" 0.0; \
125                color: 255 255 255 255; \
126             } \
127          } \
128          part { name: "elm.swallow.content"; \
129             type: SWALLOW; \
130             clip_to: "disclip"; \
131             description { state: "default" 0.0; \
132                fixed: 1 0; \
133                visible: 0; \
134                align: 0.0 0.5; \
135                rel1 { \
136                   to_x: "bg"; \
137                   relative: 1.0 0.0; \
138                   offset: 1 1; \
139                } \
140                rel2 { \
141                   to_x: "bg"; \
142                   offset: 2 -2; \
143                } \
144             } \
145             description { state: "visible" 0.0; \
146                inherit: "default" 0.0; \
147                fixed: 1 1; \
148                visible: 1; \
149                aspect: 1.0 1.0; \
150                aspect_preference: VERTICAL; \
151             } \
152             description { state: "disabled" 0.0; \
153                inherit: "default" 0.0; \
154             } \
155             description { state: "disabled_visible" 0.0; \
156                inherit: "default" 0.0; \
157                fixed: 1 1; \
158                visible: 1; \
159                aspect: 1.0 1.0; \
160             } \
161          } \
162          part { name: "elm.text"; \
163             type: TEXTBLOCK; \
164             mouse_events: 0; \
165             clip_to: "disclip"; \
166             scale: 1; \
167             description { state: "default" 0.0; \
168                visible: 0; \
169                fixed: 0 1; \
170                rel1 { \
171                   relative: 1.0 0.5; \
172                   offset: 1 1; \
173                   to_x: "elm.swallow.content"; \
174                } \
175                rel2 { \
176                   relative: 1.0 0.5; \
177                   offset: -2 -2; \
178                } \
179                align: 0.0 0.5; \
180                text { \
181                   style: "radio_label_textblock_style"; \
182                   min: 0 0; \
183                } \
184             } \
185             description { state: "visible" 0.0; \
186                inherit: "default" 0.0; \
187                visible: 1; \
188                text.min: 1 1; \
189             } \
190             description { state: "disabled" 0.0; \
191                inherit: "default" 0.0; \
192             } \
193             description { state: "disabled_visible" 0.0; \
194                inherit: "default" 0.0; \
195                visible: 1; \
196                text { \
197                   style: "radio_label_textblock_style_disable"; \
198                   min: 0 0; \
199                } \
200             } \
201          } \
202          part { name: "over1"; \
203             type: RECT; \
204             ignore_flags: ON_HOLD; \
205             description { state: "default" 0.0; \
206                color: 0 0 0 0; \
207             } \
208          } \
209          part { name: "over2"; \
210             type: RECT; \
211             repeat_events:1; \
212             description { state: "default" 0.0; \
213                color: 0 0 0 0; \
214             } \
215          } \
216          part { name: "disclip"; \
217             type: RECT; \
218             mouse_events: 0; \
219             description { state: "default" 0.0; \
220                color: RADIO_DISCLIP_NORMAL_COLOR_INC; \
221             } \
222             description { state: "disabled" 0.0; \
223                color: RADIO_DISCLIP_DISABLED_COLOR_INC; \
224             } \
225          } \
226          part { name: "disabler"; \
227             type: RECT; \
228             description { state: "default" 0.0; \
229                visible: 0; \
230             } \
231             description { state: "disabled" 0.0; \
232                inherit: "default" 0.0; \
233                visible: 1; \
234                color: 0 0 0 0; \
235             } \
236          } \
237       } \
238       programs { \
239          program { name: "click"; \
240             signal: "mouse,clicked,1"; \
241             source: "over1"; \
242             action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
243          } \
244          program { name: "touch_sound"; \
245             signal: "mouse,clicked,1"; \
246             source: "over2"; \
247             action: PLAY_SAMPLE "touch_sound" 1.0; \
248          } \
249          program { name: "bg_normal"; \
250             signal: "mouse,up,1"; \
251             source: "over2"; \
252             script { \
253                if (get_int(radio_state) == RADIO_STATE_VISIBLE) \
254                   set_state(PART:"radio", "visible", 0.0); \
255                else \
256                   set_state(PART:"radio", "default", 0.0); \
257                set_state(PART:"bg", "default", 0.0); \
258             } \
259          } \
260          program { name: "pressed"; \
261             signal: "mouse,down,1"; \
262             source: "over2"; \
263             script { \
264                if (get_int(radio_state) == RADIO_STATE_VISIBLE) \
265                   set_state(PART:"radio", "pressed", 0.0); \
266                else \
267                   set_state(PART:"radio", "default", 0.0); \
268                set_state(PART:"bg", "pressed", 0.0); \
269             } \
270          } \
271          program { name: "mouse,out"; \
272             signal: "mouse,out"; \
273             source: "over2"; \
274             script { \
275                if (get_int(radio_state) == RADIO_STATE_VISIBLE) \
276                   set_state(PART:"radio", "visible", 0.0); \
277                else \
278                   set_state(PART:"radio", "default", 0.0); \
279                set_state(PART:"bg", "default", 0.0); \
280             } \
281          } \
282          program { name: "radio_on"; \
283             signal: "elm,state,radio,on"; \
284             source: "elm"; \
285             script { \
286                set_int(radio_state, RADIO_STATE_VISIBLE); \
287                run_program(PROGRAM:"radio_show_effect"); \
288                run_program(PROGRAM:"radio_draw_effect"); \
289             } \
290          } \
291          program { name: "radio_off"; \
292             signal: "elm,state,radio,off"; \
293             source: "elm"; \
294             script { \
295                set_int(radio_state, RADIO_STATE_DEFAULT); \
296                set_state(PART:"opacity_clip", "default", 0.0); \
297                set_state(PART:"radio", "default", 0.0); \
298             } \
299          } \
300          program { name: "radio_show_effect"; \
301             action: STATE_SET "visible" 0.0; \
302             transition: LINEAR 0.233; \
303             target: "opacity_clip"; \
304          } \
305          program { name: "radio_draw_effect"; \
306             action: STATE_SET "visible" 0.0; \
307             transition: LINEAR 0.267; \
308             target: "radio"; \
309          } \
310          program { name: "text_show"; \
311             signal: "elm,state,text,visible"; \
312             source: "elm"; \
313             action: STATE_SET "visible" 0.0; \
314             target: "elm.text"; \
315          } \
316          program { name: "text_hide"; \
317             signal: "elm,state,text,hidden"; \
318             source: "elm"; \
319             action: STATE_SET "default" 0.0; \
320             target: "elm.text"; \
321          } \
322          program { name: "icon_show"; \
323             signal: "elm,state,icon,visible"; \
324             source: "elm"; \
325             action: STATE_SET "visible" 0.0; \
326             target: "elm.swallow.content"; \
327          } \
328          program { name: "icon_hide"; \
329             signal: "elm,state,icon,hidden"; \
330             source: "elm"; \
331             action: STATE_SET "default" 0.0; \
332             target: "elm.swallow.content"; \
333          } \
334          program { name: "disable"; \
335             signal: "elm,state,disabled"; \
336             source: "elm"; \
337             action: STATE_SET "disabled" 0.0; \
338             target: "disclip"; \
339             target: "bg"; \
340             target: "disabler"; \
341             after: "disable_text"; \
342          } \
343          program { name: "disable_text"; \
344             script { \
345                new st[31]; \
346                new Float:vl; \
347                get_state(PART:"elm.text", st, 30, vl); \
348                if (!strcmp(st, "visible")) \
349                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
350                else \
351                  set_state(PART:"elm.text", "disabled", 0.0); \
352                get_state(PART:"elm.swallow.content", st, 30, vl); \
353                if (!strcmp(st, "visible")) \
354                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
355                else \
356                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
357                get_state(PART:"radio", st, 30, vl); \
358                if (!strcmp(st, "visible")) \
359                  set_state(PART:"radio", "disabled_visible", 0.0); \
360                else \
361                  set_state(PART:"radio", "disabled", 0.0); \
362             } \
363          } \
364          program { name: "enable"; \
365             signal: "elm,state,enabled"; \
366             source: "elm"; \
367             action: STATE_SET "default" 0.0; \
368             target: "disabler"; \
369             target: "disclip"; \
370             target: "bg"; \
371             after: "enable_text"; \
372          } \
373          program { name: "enable_text"; \
374             script { \
375                new st[31]; \
376                new Float:vl; \
377                get_state(PART:"elm.text", st, 30, vl); \
378                if (!strcmp(st, "disabled_visible")) \
379                  set_state(PART:"elm.text", "visible", 0.0); \
380                else \
381                  set_state(PART:"elm.text", "default", 0.0); \
382                get_state(PART:"elm.swallow.content", st, 30, vl); \
383                if (!strcmp(st, "disabled_visible")) \
384                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
385                else \
386                  set_state(PART:"elm.swallow.content", "default", 0.0); \
387                get_state(PART:"radio", st, 30, vl); \
388                if (!strcmp(st, "disabled_visible")) \
389                  { \
390                     set_state(PART:"opacity_clip", "visible", 0.0); \
391                     set_state(PART:"radio", "visible", 0.0); \
392                  } \
393                else \
394                  { \
395                     set_state(PART:"opacity_clip", "default", 0.0); \
396                     set_state(PART:"radio", "default", 0.0); \
397                  } \
398             } \
399          } \
400       } \
401    }
402
403 ///////////////////////////////////////////////////////////////////////////////////////
404 RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
405
406 ///////////////////////////////////////////////////////////////////////////////////////
407 RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC)
408
409 ///////////////////////////////////////////////////////////////////////////////////////
410
411 #undef RADIO_STATE_DEFAULT
412 #undef RADIO_STATE_VISIBLE