3f21f4dd3bd847a9840dbfd0469544b2c2414f0f
[profile/ivi/efl-theme-tizen.git] / themes / widgets / diskselector.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 ///////////////////////////////////////////////////////////////////////////////////////
21 //
22 // diskselector
23 //
24 ///////////////////////////////////////////////////////////////////////////////////////
25 group { name: "elm/diskselector/base/default";
26    alias: "elm/diskselector/base/datetime/default";
27    alias: "elm/diskselector/base/timepicker";
28
29    parts {
30       part { name: "bg";
31          type: RECT;
32          mouse_events: 0;
33          description { state: "default" 0.0;
34             color: 0 0 0 0;
35          }
36       }
37       part { name: "elm.swallow.content";
38          type: SWALLOW;
39          description { state: "default" 0.0;
40             rel1.to: "bg";
41             rel2.to: "bg";
42          }
43       }
44    }
45 }
46
47 group { name: "elm/diskselector/item/default";
48    alias: "elm/diskselector/item/datetime/default";
49    alias: "elm/diskselector/item/timepicker";
50
51    data {
52       item: "len_threshold" "14";
53       item: "min_height"  DISKSELECTOR_DF_DATA_MIN_HEIGHT_INC;
54    }
55
56    parts {
57      part {
58         name: "elm.text";
59         type: TEXT;
60         mouse_events: 0;
61         scale: 1;
62         description {
63            state: "default" 0.0;
64            min: DISKSELECTOR_DF_ITEM_MIN_SIZE_INC;
65            fixed: 1 1;
66            align: 0 0;
67            color: DISKSELECTOR_DF_FONT_COLOR_INC;
68            visible: 1;
69            text {
70               font: "Tizen:style=Medium";
71               size: DISKSELECTOR_DF_FONT_SIZE_INC;
72               min: 1 1;
73               text_class: "tizen";
74            }
75         }
76         description {
77            state: "selected" 0.0;
78            min: DISKSELECTOR_DF_ITEM_MIN_SIZE_INC;
79            fixed: 1 1;
80            align: 0 0;
81            color: 255 255 255 255;
82            visible: 1;
83            text {
84               font: "Tizen:style=Medium";
85               size: DISKSELECTOR_DF_FONT_SIZE_INC;
86               min: 1 1;
87            }
88         }
89         description { state: "show" 0.0;
90            inherit: "default" 0.0;
91            visible: 1;
92         }
93         description { state: "default_small" 0.0;
94            inherit: "default" 0.0;
95            visible: 1;
96            text.size: 10;
97         }
98         description { state: "left_side" 0.0;
99            inherit: "default" 0.0;
100            visible: 1;
101         }
102         description { state: "right_side" 0.0;
103            inherit: "default" 0.0;
104            visible: 1;
105         }
106         description { state: "mouse_down" 0.0;
107            inherit: "default" 0.0;
108            color: DISKSELECTOR_DF_FONT_MOUSE_DOWN_COLOR_INC;
109            visible: 1;
110         }
111         description { state: "selected_mouse_down" 0.0;
112            inherit: "default" 0.0;
113            color: DISKSELECTOR_DF_FONT_MOUSE_DOWN_COLOR_INC;
114            visible: 1;
115         }
116      }
117
118      part {
119         name: "over1";
120         mouse_events: 1;
121         repeat_events: 1;
122         description {
123            state: "default" 0.0;
124         }
125      }
126    }
127
128    programs {
129       program {
130          name: "elm,state,selected";
131          signal: "elm,state,selected";
132          source: "elm";
133          action: STATE_SET "selected" 0.0;
134          target: "elm.text";
135       }
136       program {
137          name: "elm,state,default";
138          signal: "elm,state,default";
139          source: "elm";
140          action: STATE_SET "default" 0.0;
141          target: "elm.text";
142       }
143       program {
144          name: "item_click";
145          signal: "mouse,clicked,1";
146          source: "over1";
147          action: SIGNAL_EMIT "elm,action,click" "";
148       }
149       program {
150          name: "item_mouse_down";
151          signal: "mouse,down,1";
152          source: "over1";
153          script {
154             new st[30];
155             new Float:vl;
156             get_state(PART:"elm.text", st, 30, vl)
157             if (!strncmp(st, "selected", 8)) {
158                set_state(PART:"elm.text", "selected_mouse_down", 0.0);
159             } else {
160                set_state(PART:"elm.text", "mouse_down", 0.0);
161             }
162          }
163       }
164       program {
165          name: "item_mouse_up";
166          signal: "mouse,up,1";
167          source: "over1";
168          script {
169             new st[30];
170             new Float:vl;
171             get_state(PART:"elm.text", st, 30, vl)
172             if (!strncmp(st, "mouse_down", 10)) {
173                set_state(PART:"elm.text", "default", 0.0);
174             } else if (!strncmp(st, "selected_mouse_down", 19)) {
175                set_state(PART:"elm.text", "selected", 0.0);
176             }
177          }
178       }
179    }
180 }