f4e6086fea5265c58b7d9d8e99edd86c88f9d19c
[apps/core/preloaded/quickpanel.git] / data / quickpanel_datetime.edc
1 /*
2  * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19
20 images {
21         image: "icon_indicator_setting.png" COMP;
22         image: "line_indicator_divider.png" COMP;
23         image: "bg_press.#.png" COMP;
24 }
25
26 styles {
27         style {
28                 name: "font_time_am_pm_style";
29                 base: "font=Tizen:style=Regular  font_size=26 valign=middle  ellipsis=1.0 wrap=none";
30                 tag: "time" "+ color=#FFFFFF ";
31                 tag: "ampm" "+ color=#FFFFFF ";
32         }
33
34         style {
35                 name: "font_date_style";
36                 base: "font=Tizen:style=Regular  font_size=22 color=#FFFFFF valign=middle color_class=ATO009  ellipsis=1.0 wrap=none";
37         }
38 }
39
40 group {
41         name: "quickpanel/datetime";
42
43         script {
44                 public g_is_timedate_clickable;
45         }
46
47         parts {
48                 part { name: "base";
49                         type: RECT;
50                         repeat_events: 1;
51                         scale: 1;
52                         description {
53                                 state: "default" 0.0;
54                                 color_class: QP_BACKGROUND_COLOR;
55                                 visible: 0;
56                         }
57                 }
58                 QUICKPANEL_FOCUS_OBJECT("focus", "base", "base")
59
60                 part { name: "space.button.setting";
61                         type: SPACER;
62                         scale: 1;
63                         description {
64                                 state: "default" 0.0;
65                                 min: 60 0;
66                                 fixed: 1 0;
67                                 align: 1.0 0.5;
68                                 rel1 {
69                                         relative : 1.0 0.0;
70                                         to: "base";
71                                 }
72                                 rel2 {
73                                         relative : 1.0 1.0;
74                                         to: "base";
75                                 }
76                         }
77                 }
78                 QUICKPANEL_FOCUS_OBJECT("focus.setting", "space.button.setting", "space.button.setting")
79
80                 part { name: "space.divider";
81                         type: SPACER;
82                         scale: 1;
83                         description {
84                                 state: "default" 0.0;
85                                 min: 1 0;
86                                 fixed: 1 0;
87                                 align: 1.0 0.5;
88                                 rel1 {
89                                         relative : 0.0 0.0;
90                                         to: "space.button.setting";
91                                 }
92                                 rel2 {
93                                         relative : 0.0 1.0;
94                                         to: "space.button.setting";
95                                 }
96                         }
97                 }
98
99                 part {
100                         name: "space.datetime";
101                         type: SPACER;
102                         scale: 1;
103                         description {
104                                 state: "default" 0.0;
105                                 rel1 {
106                                         relative : 0.0 0.0;
107                                         to: "base";
108                                 }
109                                 rel2 {
110                                         relative : 0.0 1.0;
111                                         to: "space.divider";
112                                 }
113                         }
114                 }
115                 QUICKPANEL_FOCUS_OBJECT("focus.datetime", "space.datetime", "space.datetime")
116
117                 part { name: "image.button.setting.bg";
118                         type: IMAGE;
119                         scale: 1;
120                         description {
121                                 state: "default" 0.0;
122                                 min: 0 36;
123                                 fixed: 0 1;
124                                 align: 0.0 0.5;
125                                 rel1 {
126                                         relative: 0.0 0.5;
127                                         to: "space.button.setting";
128                                 }
129                                 rel2 {
130                                         relative: 1.0 0.5;
131                                         to: "space.button.setting";
132                                 }
133                                 image {
134                                         normal: "bg_press.#.png";
135                                 }
136                                 color_class: "F043P";
137                                 visible: 0;
138                         }
139                         description {
140                                 state: "pressed" 0.0;
141                                 inherit: "default";
142                                 visible: 1;
143                         }
144                 }
145
146                 part { name: "image.datetime.bg";
147                         type: IMAGE;
148                         scale: 1;
149                         description {
150                                 state: "default" 0.0;
151                                 min: 0 36;
152                                 fixed: 0 1;
153                                 align: 0.0 0.5;
154                                 rel1 {
155                                         relative : 0.0 0.5;
156                                         to: "space.datetime";
157                                 }
158                                 rel2 {
159                                         relative : 1.0 0.5;
160                                         to: "space.datetime";
161                                 }
162                                 image {
163                                         normal: "bg_press.#.png";
164                                 }
165                                 color_class: "F043P";
166                                 visible: 0;
167                         }
168                         description {
169                                 state: "pressed" 0.0;
170                                 inherit: "default";
171                                 visible: 1;
172                         }
173                 }
174
175                 part { name: "image.button.setting";
176                         type: IMAGE;
177                         mouse_events: 0;
178                         scale: 1;
179                         description {
180                                 state: "default" 0.0;
181                                 min: 30 30;
182                                 fixed: 1 1;
183                                 align: 0.5 0.5;
184                                 rel1 {
185                                         relative: 0.5 0.5;
186                                         to: "space.button.setting";
187                                 }
188                                 rel2 {
189                                         relative: 0.5 0.5;
190                                         to: "space.button.setting";
191                                 }
192                                 image {
193                                         normal:"icon_indicator_setting.png";
194                                 }
195                                 color_class: "AO025";
196                         }
197                 }
198
199                 part { name: "image.divider";
200                         type: IMAGE;
201                         scale: 1;
202                         description {
203                                 state: "default" 0.0;
204                                 min: 1 24;
205                                 fixed: 1 1;
206                                 align: 0.5 0.5;
207                                 rel1 {
208                                         relative: 0.0 0.5;
209                                         to: "space.divider";
210                                 }
211                                 rel2 {
212                                         relative: 1.0 0.5;
213                                         to: "space.divider";
214                                 }
215                                 image {
216                                         normal: "line_indicator_divider.png";
217                                 }
218                                 color_class: "AO027";
219                         }
220                 }
221
222                 part { name: "divider.padding.left";
223                         type: SPACER;
224                         scale: 1;
225                         description {
226                                 state: "default" 0.0;
227                                 min: 15 0;
228                                 fixed: 1 0;
229                                 align: 1.0 0.5;
230                                 rel1 {
231                                         relative: 0.0 0.0;
232                                         to: "space.divider";
233                                 }
234                                 rel2 {
235                                         relative: 0.0 1.0;
236                                         to: "space.divider";
237                                 }
238                         }
239                 }
240
241                 part { name: "text.time";
242                         type: TEXTBLOCK;
243                         mouse_events: 0;
244                         scale: 1;
245                         description {
246                                 state: "default" 0.0;
247                                 min: 0 (3 + 30 + 3);
248                                 fixed: 0 1;
249                                 align: 1.0 0.5;
250                                 rel1 {
251                                         relative : 0.0 0.5;
252                                         to: "divider.padding.left";
253                                 }
254                                 rel2 {
255                                         relative : 0.0 0.5;
256                                         to: "divider.padding.left";
257                                 }
258                                 text {
259                                         style: "font_time_am_pm_style";
260                                         min: 1 0;
261                                         max: 1 0;
262                                         align: 1.0 0.5;
263                                 }
264                         }
265                 }
266
267                 part { name: "date.left.padding";
268                         type: SPACER;
269                         scale: 1;
270                         description {
271                                 state: "default" 0.0;
272                                 min: 15 0;
273                                 fixed: 1 0;
274                                 align: 0.0 0.0;
275                                 rel1 {
276                                         relative : 0.0 0.0;
277                                         to: "space.datetime";
278                                 }
279                                 rel2 {
280                                         relative : 0.0 1.0;
281                                         to: "space.datetime";
282                                 }
283                         }
284                 }
285                 part {
286                         name: "date.top.padding";
287                         type: SPACER;
288                         scale: 1;
289                         description {
290                                 state: "default" 0.0;
291                                 min: 0 0;
292                                 fixed: 0 1;
293                                 align: 0.0 0.0;
294                                 rel1 {
295                                         relative: 0.0 0.0;
296                                         to: "space.datetime";
297                                 }
298                                 rel2 {
299                                         relative: 1.0 0.0;
300                                         to: "space.datetime";
301                                 }
302                         }
303                 }
304
305                 part { name: "text.date";
306                         type: TEXTBLOCK;
307                         mouse_events: 0;
308                         scale: 1;
309                         description {
310                                 state: "default" 0.0;
311                                 min: 0 (8 + 20 + 8);
312                                 fixed: 0 1;
313                                 align: 0.0 0.5;
314                                 rel1 {
315                                         relative : 1.0 1.0;
316                                         to_x: "date.left.padding";
317                                         to_y: "date.top.padding";
318                                 }
319                                 rel2 {
320                                         relative : 0.0 1.0;
321                                         to_x: "text.time";
322                                         to_y: "space.datetime";
323                                 }
324                                 text {
325                                         style: "font_date_style";
326                                         min: 1 0;
327                                         max: 1 0;
328                                         align: 0.0 0.5;
329                                 }
330                         }
331                 }
332         }
333
334         programs {
335                 program {
336                         name: "timedate.init";
337                         signal: "load";
338                         script{
339                                 set_int(g_is_timedate_clickable, 1);
340                         }
341                 }
342                 program{
343                         name: "button.setting.down";
344                         signal: "mouse,down,*";
345                         source: "focus.setting";
346                         action: STATE_SET "pressed" 0.0;
347                         target: "image.button.setting.bg";
348                 }
349                 program{
350                         name: "button.setting.up";
351                         signal: "mouse,up,*";
352                         source: "focus.setting";
353                         action: STATE_SET "default" 0.0;
354                         target: "image.button.setting.bg";
355                 }
356                 program {
357                         name: "timendate.click.enable";
358                         signal: "timendate.click.enable";
359                         source: "prog";
360                         script {
361                                 set_int(g_is_timedate_clickable, 1);
362                         }
363                 }
364                 program {
365                         name: "timendate.click.disable";
366                         signal: "timendate.click.disable";
367                         source: "prog";
368                         script {
369                                 set_int(g_is_timedate_clickable, 0);
370                         }
371                 }
372                 program{
373                         name: "date_time.down";
374                         signal: "mouse,down,*";
375                         source: "focus.datetime";
376                         script {
377                                 if (get_int(g_is_timedate_clickable) == 1) {
378                                         set_state(PART:"image.datetime.bg", "pressed", 0.0);
379                                 }
380                         }
381                 }
382                 program{
383                         name: "date_time.up";
384                         signal: "mouse,up,*";
385                         source: "focus.datetime";
386                         action: STATE_SET "default" 0.0;
387                         target: "image.datetime.bg";
388                 }
389         }
390 }
391