e239efeff55acba0a5bacb1d4603874cf29b6f76
[platform/core/uifw/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               text_class: "tizen";
88            }
89         }
90         description { state: "show" 0.0;
91            inherit: "default" 0.0;
92            visible: 1;
93         }
94         description { state: "default_small" 0.0;
95            inherit: "default" 0.0;
96            visible: 1;
97            text.size: 10;
98         }
99         description { state: "left_side" 0.0;
100            inherit: "default" 0.0;
101            visible: 1;
102         }
103         description { state: "right_side" 0.0;
104            inherit: "default" 0.0;
105            visible: 1;
106         }
107         description { state: "mouse_down" 0.0;
108            inherit: "default" 0.0;
109            color: DISKSELECTOR_DF_FONT_MOUSE_DOWN_COLOR_INC;
110            visible: 1;
111         }
112         description { state: "selected_mouse_down" 0.0;
113            inherit: "default" 0.0;
114            color: DISKSELECTOR_DF_FONT_MOUSE_DOWN_COLOR_INC;
115            visible: 1;
116         }
117      }
118
119      part {
120         name: "over1";
121         type: RECT;
122         mouse_events: 1;
123         repeat_events: 1;
124         description {
125            state: "default" 0.0;
126            color: 0 0 0 0;
127         }
128      }
129    }
130
131    programs {
132       program {
133          name: "elm,state,selected";
134          signal: "elm,state,selected";
135          source: "elm";
136          action: STATE_SET "selected" 0.0;
137          target: "elm.text";
138       }
139       program {
140          name: "elm,state,default";
141          signal: "elm,state,default";
142          source: "elm";
143          action: STATE_SET "default" 0.0;
144          target: "elm.text";
145       }
146       program {
147          name: "item_click";
148          signal: "mouse,clicked,1";
149          source: "over1";
150          action: SIGNAL_EMIT "elm,action,click" "";
151       }
152       program {
153          name: "item_mouse_down";
154          signal: "mouse,down,1";
155          source: "over1";
156          script {
157             new st[30];
158             new Float:vl;
159             get_state(PART:"elm.text", st, 30, vl)
160             if (!strncmp(st, "selected", 8)) {
161                set_state(PART:"elm.text", "selected_mouse_down", 0.0);
162             } else {
163                set_state(PART:"elm.text", "mouse_down", 0.0);
164             }
165          }
166       }
167       program {
168          name: "item_mouse_up";
169          signal: "mouse,up,1";
170          source: "over1";
171          script {
172             new st[30];
173             new Float:vl;
174             get_state(PART:"elm.text", st, 30, vl)
175             if (!strncmp(st, "mouse_down", 10)) {
176                set_state(PART:"elm.text", "default", 0.0);
177             } else if (!strncmp(st, "selected_mouse_down", 19)) {
178                set_state(PART:"elm.text", "selected", 0.0);
179             }
180          }
181       }
182    }
183 }