0665a46f0576e6eb0c3369c91c6a4bd98fc3b94c
[platform/core/uifw/efl-theme-tizen.git] / themes / widgets / datetime.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
19 ///////////////////////////////////////////////////////////////////////////////
20 // datetime
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #define DATETIME_FIELD(_pos, _after) \
24    part {\
25       name: "field"#_pos; \
26       type: SWALLOW; \
27       scale: 1;\
28       clip_to: "clipper";\
29       repeat_events: 1;\
30       description { state: "default" 0.0; \
31          visible: 0;\
32          min: 0 0;\
33          align: 0.0 0.5;\
34          fixed: 1 1;\
35          rel1 {\
36             relative: 1.0 0.0;\
37             to: "separator"#_after;\
38          }\
39          rel2 {\
40             relative: 1.0 1.0;\
41             to: "separator"#_after;\
42          }\
43       }\
44       description { state: "enable" 0.0;\
45          inherit: "default" 0.0;\
46          visible: 1;\
47          min: DATETIME_FIELD_MIN_SIZE_INC;\
48       }\
49    }\
50    programs{\
51       program {\
52          name: "field_"#_pos"enabled";\
53          signal: "field"#_pos",enable";\
54          source: "elm";\
55          action: STATE_SET "enable" 0.0;\
56          target: "field"#_pos;\
57       }\
58       program {\
59          name: "field_"#_pos"disabled";\
60          signal: "field"#_pos",disable";\
61          source: "elm";\
62          action: STATE_SET "default" 0.0;\
63          target: "field"#_pos;\
64       }\
65     }
66
67 #define DATETIME_SEPARATOR(_pos) \
68    part {\
69       name: "separator"#_pos; \
70       type: TEXT;\
71       scale: 1;\
72       clip_to: "clipper";\
73       repeat_events: 1;\
74       description {\
75          state: "default" 0.0;\
76          visible: 0;\
77          min: DATETIME_SEPARATOR_MIN_SIZE_INC;\
78          max: DATETIME_SEPARATOR_MIN_SIZE_INC;\
79          align: 0.0 0.5;\
80          fixed: 1 1;\
81          rel1 {\
82             relative: 1.0 0.0;\
83             to: "field"#_pos;\
84          }\
85          rel2 {\
86             relative: 1.0 1.0;\
87             to: "field"#_pos;\
88          }\
89          color: DATETIME_SEPARATOR_TEXT_COLOR_INC;\
90          text {\
91             font: "Tizen:style=Regular";\
92             size: DATETIME_SEPARATOR_TEXT_FONT_SIZE_INC;\
93             min: 1 0; \
94             text_class: "tizen";\
95          }\
96       }\
97       description { state: "enable" 0.0;\
98          inherit: "default" 0.0;\
99          visible: 1;\
100       }\
101       description { state: "hide" 0.0;\
102          inherit: "default" 0.0;\
103          min: 0 0;\
104          max: 0 0;\
105       }\
106    }\
107    programs {\
108       program {\
109          name: "separator"#_pos",enabled";\
110          signal: "field"#_pos",separator,enable";\
111          source: "elm";\
112          action: STATE_SET "enable" 0.0;\
113          target: "separator"#_pos;\
114       }\
115       program {\
116          name: "separator"#_pos",disabled";\
117          signal: "field"#_pos",separator,disable";\
118          source: "elm";\
119          script {\
120             new st[31];\
121             new Float:vl;\
122             get_state(PART:"separator"#_pos, st, 30, vl);\
123             if (strcmp(st, "hide")) \
124             {\
125                set_state(PART:"separator"#_pos, "default", 0.0);\
126             }\
127          }\
128       }\
129       program {\
130          name: "separator"#_pos",hide";\
131          signal: "field"#_pos",disable";\
132          source: "elm";\
133          action: STATE_SET "hide" 0.0;\
134          target: "separator"#_pos;\
135       }\
136    }
137
138
139 group { name: "elm/datetime/base/default";
140    parts {
141       part {
142          name: "bg";
143          type: RECT;
144          scale: 1;
145          description {
146             state: "default" 0.0;
147             color: 0 0 0 0;
148          }
149       }
150       part {
151          name: "left.padding";
152          type: RECT;
153          scale: 1;
154          clip_to: "clipper";
155          mouse_events: 0;
156          description {
157             state: "default" 0.0;
158             visible: 0;
159             min: DATETIME_LEFT_PADDING_SIZE_INC;
160             max: DATETIME_LEFT_PADDING_SIZE_INC;
161             align: 0.0 0.5;
162             fixed: 1 1;
163             rel1.to: "bg";
164             rel2 {
165                relative: 0.0 1.0;
166                to: "bg";
167             }
168          }
169       }
170       part {
171          name: "field0";
172          type: SWALLOW;
173          scale: 1;
174          clip_to: "clipper";
175          repeat_events: 1;
176          description {
177             state: "default" 0.0;
178             visible: 0;
179             min: 0 0;
180             align: 0.0 0.5;
181             fixed: 1 0;
182             rel1 {
183                relative: 0.5 0.0;
184                to_x: "left.padding";
185             }
186             rel2 {
187                relative: 0.5 1.0;
188                to_x: "left.padding";
189             }
190          }
191          description { state: "enable" 0.0;
192             inherit: "default" 0.0;
193             visible: 1;
194             min: DATETIME_FIELD_MIN_SIZE_INC;
195          }
196       }
197       DATETIME_SEPARATOR(0)
198       DATETIME_FIELD(1, 0)
199       DATETIME_SEPARATOR(1)
200       DATETIME_FIELD(2, 1)
201       DATETIME_SEPARATOR(2)
202       DATETIME_FIELD(3, 2)
203       DATETIME_SEPARATOR(3)
204       DATETIME_FIELD(4, 3)
205       DATETIME_SEPARATOR(4)
206       DATETIME_FIELD(5, 4)
207       DATETIME_SEPARATOR(5)
208       part {
209          name: "right.padding";
210          type: RECT;
211          scale: 1;
212          clip_to: "clipper";
213          mouse_events: 0;
214          description {
215             state: "default" 0.0;
216             visible: 0;
217             min: DATETIME_LEFT_PADDING_SIZE_INC;
218             max: DATETIME_LEFT_PADDING_SIZE_INC;
219             align: 1.0 0.5;
220             fixed: 1 1;
221             rel2 {
222                relative: 1.0 0.0;
223                to: "bg";
224             }
225             rel2.to: "bg";
226          }
227       }
228       part {
229          name: "clipper";
230          type: RECT;
231          description { state: "default" 0.0;
232             color: 255 255 255 255;
233          }
234          description { state: "visible" 0.0;
235             inherit: "default" 0.0;
236             color: 255 255 255 102;
237          }
238       }
239       part {
240          name: "disabler";
241          type: RECT;
242          description { state: "default" 0.0;
243             color: 0 0 0 0;
244             visible: 0;
245          }
246          description { state: "visible" 0.0;
247             inherit: "default" 0.0;
248             visible: 1;
249          }
250       }
251    }
252    programs {
253       program {
254          name: "disble_datetime";
255          signal: "elm,state,disabled";
256          source: "elm";
257          action: STATE_SET "visible" 0.0;
258          target: "disabler";
259          target: "clipper";
260       }
261       program {
262          name: "enable_datetime";
263          signal: "elm,state,enabled";
264          source: "elm";
265          action: STATE_SET "default" 0.0;
266          target: "disabler";
267          target: "clipper";
268       }
269       program {
270          name: "field0,enabled";
271          signal: "field0,enable";
272          source: "elm";
273          action: STATE_SET "enable" 0.0;
274          target: "field0";
275       }
276       program {
277          name: "field0,disabled";
278          signal: "field0,disable";
279          source: "elm";
280          action: STATE_SET "default" 0.0;
281          target: "field0";
282       }
283    }
284 }
285 group { name: "elm/spinner/base/default";
286    alias: "elm/spinner/base/datetime_popup";
287    alias: "elm/spinner/base/datetime_popup/year";
288    alias: "elm/spinner/base/datetime_popup/month";
289    alias: "elm/spinner/base/datetime_popup/date";
290    alias: "elm/spinner/base/datetime_popup/hour";
291    alias: "elm/spinner/base/datetime_popup/minute";
292    images {
293       image: "00_picker_arrow_down.png" COMP;
294       image: "00_picker_arrow_up.png" COMP;
295       image: "00_picker_arrow_down_press_web.png" COMP;
296       image: "00_picker_arrow_up_press_web.png" COMP;
297       image: "00_button_01.png" COMP;
298       image: "00_button_01_press.png" COMP;
299    }
300    parts {
301       part { name: "bg";
302          type: RECT;
303          scale: 1;
304          description { state: "default" 0.0;
305             color: 0 0 0 0;
306          }
307       }
308       part { name: "up.image";
309          scale: 1;
310          description { state: "default" 0.0;
311             align: 0.5 0.0;
312             min: SPINNER_UP_DOWN_IMAGE_SIZE_INC;
313             max: SPINNER_UP_DOWN_IMAGE_SIZE_INC;
314             image {
315                normal: "00_button_01.png";
316                border: SPINNER_UP_DOWN_IMAGE_BORDER_SIZE_INC;
317                border_scale: 1;
318             }
319          }
320          description { state: "pressed" 0.0;
321             inherit: "default" 0.0;
322             image.normal: "00_button_01_press.png";
323          }
324       }
325       part { name: "up.image.arrow";
326          scale: 1;
327          description { state: "default" 0.0;
328             rel1.to: "up.image";
329             rel2.to: "up.image";
330             min: SPINNER_UP_DOWN_ARROW_IMAGE_SIZE_INC;
331             max: SPINNER_UP_DOWN_ARROW_IMAGE_SIZE_INC;
332             image.normal: "00_picker_arrow_up.png";
333          }
334          description { state: "pressed" 0.0;
335             inherit: "default" 0.0;
336             image.normal: "00_picker_arrow_up_press_web.png";
337          }
338       }
339       part { name: "down.image";
340          scale: 1;
341          description { state: "default" 0.0;
342             align: 0.5 1.0;
343             min: SPINNER_UP_DOWN_IMAGE_SIZE_INC;
344             max: SPINNER_UP_DOWN_IMAGE_SIZE_INC;
345             image {
346                normal: "00_button_01.png";
347                border: SPINNER_UP_DOWN_IMAGE_BORDER_SIZE_INC;
348                border_scale: 1;
349             }
350          }
351          description { state: "pressed" 0.0;
352             inherit: "default" 0.0;
353             image.normal: "00_button_01_press.png";
354          }
355       }
356       part { name: "down.image.arrow";
357          scale: 1;
358          description { state: "default" 0.0;
359             rel1.to: "down.image";
360             rel2.to: "down.image";
361             min: SPINNER_UP_DOWN_ARROW_IMAGE_SIZE_INC;
362             max: SPINNER_UP_DOWN_ARROW_IMAGE_SIZE_INC;
363             image.normal: "00_picker_arrow_down.png";
364          }
365          description { state: "pressed" 0.0;
366             inherit: "default" 0.0;
367             image.normal: "00_picker_arrow_down_press_web.png";
368          }
369       }
370       part { name: "elm.text";
371          type: TEXT;
372          scale: 1;
373          description { state: "default" 0.0;
374             visible: 1;
375             color: SPINNER_ENTRY_TEXT_COLOR_INC;
376             min: 0 SPINNER_TEXT_HEIGHT_INC;
377             max: -1 SPINNER_TEXT_HEIGHT_INC;
378             text {
379                font: "Tizen:style=Regular";
380                size: SPINNER_ENTRY_TEXT_SIZE_INC;
381                min: 0 0;
382                max: 1 0;
383                text_class: "tizen";
384             }
385          }
386          description { state: "active" 0.0;
387             inherit: "default" 0.0;
388             visible: 0;
389          }
390       }
391       part { name: "button.events";
392          type: RECT;
393          mouse_events: 1;
394          description { state: "default" 0.0;
395             rel1.to: "elm.text";
396             rel2.to: "elm.text";
397             fixed: 1 1;
398             color: 0 0 0 0;
399          }
400       }
401       part { name: "elm.swallow.entry";
402          type: SWALLOW;
403          description { state: "default" 0.0;
404             visible: 0;
405             rel1.to: "elm.text";
406             rel2.to: "elm.text";
407             fixed: 1 1;
408          }
409          description { state: "active" 0.0;
410             inherit: "default" 0.0;
411             visible: 1;
412          }
413       }
414       part { name: "up.btn";
415          type: RECT;
416          repeat_events: 1;
417          scale: 1;
418          description { state: "default" 0.0;
419            rel1.to: "up.image";
420            rel2.to: "up.image";
421            color: 0 0 0 0;
422          }
423       }
424       part { name: "down.btn";
425          type: RECT;
426          repeat_events: 1;
427          scale: 1;
428          description { state: "default" 0.0;
429            rel1.to: "down.image";
430            rel2.to: "down.image";
431            color: 0 0 0 0;
432          }
433       }
434       part { name: "disabler";
435          type: RECT;
436          description { state: "default" 0.0;
437             color: 0 0 0 0;
438             visible: 0;
439          }
440          description { state: "disabled" 0.0;
441             inherit: "default" 0.0;
442             visible: 1;
443          }
444       }
445    }
446    programs {
447       program { name: "text_show";
448          signal: "elm,state,text,visible";
449          source: "elm";
450          action:  STATE_SET "visible" 0.0;
451          target: "elm.text";
452       }
453       program { name: "text_hide";
454          signal: "elm,state,text,hidden";
455          source: "elm";
456          action:  STATE_SET "default" 0.0;
457          target: "elm.text";
458       }
459       program { name: "dec_start_signal_emit";
460          action: SIGNAL_EMIT "elm,action,decrement,start" "";
461       }
462       program { name: "dec_stop_signal_emit";
463          action: SIGNAL_EMIT "elm,action,decrement,stop" "";
464       }
465       program { name: "inc_start_signal_emit";
466          action: SIGNAL_EMIT "elm,action,increment,start" "";
467       }
468       program { name: "inc_stop_signal_emit";
469          action: SIGNAL_EMIT "elm,action,increment,stop" "";
470       }
471       program { name: "dec";
472          signal: "mouse,down,1*";
473          source: "down.btn";
474          action:  STATE_SET "pressed" 0.0;
475          target: "down.image";
476          target: "down.image.arrow";
477          after: "dec_start_signal_emit";
478       }
479       program { name: "dec2";
480          signal: "mouse,up,1";
481          source: "down.btn";
482          action:  STATE_SET "default" 0.0;
483          target: "down.image";
484          target: "down.image.arrow";
485          after: "dec_stop_signal_emit";
486       }
487       program { name: "inc";
488          signal: "mouse,down,1*";
489          source: "up.btn";
490          action:  STATE_SET "pressed" 0.0;
491          target: "up.image";
492          target: "up.image.arrow";
493          after: "inc_start_signal_emit";
494       }
495       program { name: "inc2";
496          signal: "mouse,up,1";
497          source: "up.btn";
498          action:  STATE_SET "default" 0.0;
499          target: "up.image";
500          target: "up.image.arrow";
501          after: "inc_stop_signal_emit";
502       }
503       program { name: "disable";
504          signal: "elm,state,disabled";
505          source: "elm";
506          action: STATE_SET "disabled" 0.0;
507          target: "disabler";
508       }
509       program { name: "enable";
510          signal: "elm,state,enabled";
511          source: "elm";
512          action: STATE_SET "default" 0.0;
513          target: "disabler";
514       }
515       program { name: "active";
516          signal: "elm,state,active";
517          source: "elm";
518          action: STATE_SET "active" 0.0;
519          target: "elm.text";
520          target: "elm.swallow.entry";
521       }
522       program { name: "inactive";
523          signal: "elm,state,inactive";
524          source: "elm";
525          action: STATE_SET "default" 0.0;
526          target: "elm.text";
527          target: "elm.swallow.entry";
528       }
529       program { name: "toggle_text";
530          signal: "mouse,up,1";
531          source: "button.events";
532          action: SIGNAL_EMIT "elm,action,entry,toggle" "";
533       }
534    }
535 }
536
537 group { name: "elm/spinner/base/datetime_popup/ampm";
538    inherit: "elm/spinner/base/default";
539
540    parts {
541       part { name: "block.events";
542          type: RECT;
543          description { state: "default" 0.0;
544             color: 0 0 0 0;
545             rel1.to: "elm.text";
546             rel2.to: "elm.text";
547          }
548       }
549    }
550 }
551
552 group { name: "elm/layout/datetime_popup/date_layout";
553
554    parts {
555       part { name: "bg";
556          type: RECT;
557          scale: 1;
558          description { state: "default" 0.0;
559             color: 0 0 0 0;
560             min: DATETIME_POPUP_CONTENT_SIZE_INC;
561             max: DATETIME_POPUP_CONTENT_SIZE_INC;
562          }
563       }
564       part { name: "top.padding";
565          type: RECT;
566          scale: 1;
567          description { state: "default" 0.0;
568             color: 0 0 0 0;
569             min: 0 0;
570             max: -1 0;
571             rel1.to: "bg";
572             rel2 {
573                relative: 1.0 0.0;
574                to: "bg";
575             }
576             align: 0.5 0.0;
577          }
578       }
579       part { name: "bottom.padding";
580          type: RECT;
581          scale: 1;
582          description { state: "default" 0.0;
583             color: 0 0 0 0;
584             min: 0 0;
585             max: -1 0;
586             rel1 {
587                relative: 0.0 1.0;
588                to: "bg";
589             }
590             rel2.to: "bg";
591             align: 0.5 1.0;
592          }
593       }
594       part { name: "left.padding";
595          type: RECT;
596          scale: 1;
597          description { state: "default" 0.0;
598             color: 0 0 0 0;
599             min: DATETIME_POPUP_CONTENT_LEFT_PADDING_WIDTH_INC 0;
600             max: DATETIME_POPUP_CONTENT_LEFT_PADDING_WIDTH_INC -1;
601             rel1 {
602                relative: 0.0 1.0;
603                to_x: "bg";
604                to_y: "top.padding";
605             }
606             rel2 {
607                relative: 0.0 0.0;
608                to_x: "bg";
609                to_y: "bottom.padding";
610             }
611             align: 0.0 0.5;
612          }
613       }
614       part { name: "right.padding";
615          type: RECT;
616          scale: 1;
617          description { state: "default" 0.0;
618             color: 0 0 0 0;
619             min: DATETIME_POPUP_CONTENT_RIGHT_PADDING_WIDTH_INC 0;
620             max: DATETIME_POPUP_CONTENT_RIGHT_PADDING_WIDTH_INC -1;
621             rel2.to: "bg";
622             rel1 {
623                relative: 1.0 1.0;
624                to_x: "bg";
625                to_y: "top.padding";
626             }
627             rel2 {
628                relative: 1.0 0.0;
629                to_x: "bg";
630                to_y: "bottom.padding";
631             }
632             align: 1.0 0.5;
633          }
634       }
635       part { name: "field0";
636          type: SWALLOW;
637          scale: 1;
638          description { state: "default" 0.0;
639             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
640             rel1 {
641                relative: 1.0 0.0;
642                to: "left.padding";
643             }
644             rel2.to: "left.padding";
645             align: 0.0 0.5;
646          }
647       }
648       part { name: "center.padding1";
649          type: RECT;
650          scale: 1;
651          description { state: "default" 0.0;
652             color: 0 0 0 0;
653             min: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC 0;
654             max: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC -1;
655             rel1 {
656                relative: 1.0 0.0;
657                to: "field0";
658             }
659             rel2.to: "field0";
660             align: 0.0 0.5;
661          }
662       }
663       part { name: "field1";
664          type: SWALLOW;
665          scale: 1;
666          description { state: "default" 0.0;
667             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
668             rel1 {
669                relative: 1.0 0.0;
670                to: "center.padding1";
671             }
672             rel2 {
673                relative: 0.0 1.0;
674                to: "center.padding2";
675             }
676          }
677       }
678       part { name: "center.padding2";
679          type: RECT;
680          scale: 1;
681          description { state: "default" 0.0;
682             color: 0 0 0 0;
683             min: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC 0;
684             max: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC -1;
685             rel1.to: "field2";
686             rel2 {
687                relative: 0.0 1.0;
688                to: "field2";
689             }
690             align: 1.0 0.5;
691          }
692       }
693       part { name: "field2";
694          type: SWALLOW;
695          scale: 1;
696          description { state: "default" 0.0;
697             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
698             rel1.to: "right.padding";
699             rel2 {
700                relative: 0.0 1.0;
701                to: "right.padding";
702             }
703             align: 1.0 0.5;
704          }
705       }
706       part {
707          name: "event_area";
708          type: RECT;
709          description { state: "default" 0.0;
710             color: 0 0 0 0;
711             visible: 0;
712          }
713          description { state: "visible" 0.0;
714             inherit: "default" 0.0;
715             visible: 1;
716          }
717       }
718    }
719 }
720
721 group { name: "elm/layout/datetime_popup/time_layout";
722    inherit: "elm/layout/datetime_popup/date_layout";
723
724    parts {
725       part { name: "hour.minute.color";
726          type: TEXT;
727          scale: 1;
728          description { state: "default" 0.0;
729             rel1.to: "center.padding1";
730             rel2.to: "center.padding1";
731             color: DATETIME_POPUP_CONTENT_FIELD_TEXT_COLOR_INC;
732             text {
733                font: "Tizen:style=Regular";
734                size: DATETIME_POPUP_CONTENT_FIELD_TEXT_SIZE_INC;
735                min: 0 0;
736                text_class: "tizen";
737                text: ":";
738             }
739          }
740       }
741    }
742 }