Updated changelog
[profile/ivi/lemolo.git] / data / themes / night / keypad.edc
1 group {
2    name: "elm/layout/ofono-efl/keypad";
3
4    /*
5     * Represents the dialer keypad with the current number display and buttons.
6     *
7     * Parts:
8     *   TEXT: elm.text.display
9     *
10     * Signals:
11     *   Emit (source is "keypad"):
12     *     pressed,<ID>:  key <ID> was pressed
13     *     released,<ID>: key <ID> was released
14     *     clicked,<ID>:  key <ID> was clicked (press and release in the key)
15     *     enable,<ACTION>:  key <ID> is now clickable
16     *     disable,<ACTION>: key <ID> is now inactive
17     *
18     * Where <ID> is: numbers 0 to 9, star, hash, save, call or backspace.
19     *
20     * Where <ACTION> is: save, call or backspace.
21     */
22
23    images {
24       image: "bg_keypad.jpg" COMP;
25       image: "ico_call.png" COMP;
26       image: "ico_backspace.png" COMP;
27       image: "ico_add_contact.png" COMP;
28    }
29
30    parts {
31       part {
32          name: "bg";
33          type: RECT;
34          mouse_events: 0;
35          description {
36             state: "default" 0.0;
37             color: 255 255 255 255;
38             color_class: "primary";
39          }
40       }
41
42       part {
43          name: "elm.text.display";
44          type: TEXT;
45          mouse_events: 0;
46          scale: 1;
47          api: "display" "displays the current number";
48          description {
49             state: "default" 0.0;
50             color: 255 255 255 255;
51             color_class: "action";
52             min: (WIDTH - BORDER_PADDING*2) ACTION_HEIGHT;
53             rel1 {
54                offset: BORDER_PADDING 0;
55             }
56             rel2 {
57                relative: 1.0 0.0;
58                offset: (-BORDER_PADDING -1) (ACTION_HEIGHT - 1);
59             }
60             text {
61                text: "+1 (12) 3456-7890";
62                font: FONT_NORMAL;
63                size: SIZE_HUGE;
64                size_range: SIZE_TINY SIZE_HUGE;
65                fit: 1 1;
66                align: 0.5 0.5;
67                ellipsis: 1.0;
68             }
69          }
70       }
71
72       part {
73          name: "elm.text.contact-and-type";
74          type: TEXT;
75          mouse_events: 0;
76          scale: 1;
77          description {
78             state: "default" 0.0;
79             color: 255 255 255 255;
80             color_class: "secondary";
81             visible: 0;
82             fixed: 1 1;
83             rel1 {
84                to: "elm.text.display";
85                relative: 0.0 1.0;
86                offset: 0 0;
87             }
88             rel2 {
89                to: "elm.text.display";
90                relative: 1.0 1.0;
91                offset: -1 -1;
92             }
93             text {
94                font: FONT_BOLD;
95                size: SIZE_SMALL;
96                align: 0.5 0.0;
97                min: 0 1;
98             }
99          }
100          description {
101             state: "show" 0.0;
102             inherit: "default" 0.0;
103             visible: 1;
104          }
105       }
106
107       part {
108          name: "bg.buttons";
109          type: RECT;
110          mouse_events: 0;
111          description {
112             state: "default" 0.0;
113             color: 0 0 0 0;
114             min: WIDTH ACTION_HEIGHT;
115             max: WIDTH WIDTH; /* keep it tight centered */
116             rel1 {
117                relative: 0.0 1.0;
118                offset: 0 SEPARATOR_HEIGHT;
119                to_y: "elm.text.contact-and-type";
120             }
121             rel2 {
122                relative: 1.0 0.0;
123                offset: 0 -SEPARATOR_HEIGHT;
124                to_y: "bg.actions";
125             }
126          }
127       }
128
129       part {
130          name: "bg.actions";
131          type: RECT;
132          mouse_events: 0;
133          description {
134             state: "default" 0.0;
135             color: 0 0 0 0;
136             min: WIDTH ACTION_HEIGHT;
137             max: WIDTH 99999; /* keep it tight centered */
138             rel1 {
139                relative: 0.0 1.0;
140                offset: 0 -ACTION_HEIGHT;
141             }
142          }
143       }
144
145 #define SEPARATOR(id, rely, offy, relto)                                \
146       part {                                                            \
147          name: "separator.primary."##id;                                \
148          type: RECT;                                                    \
149          mouse_events: 0;                                               \
150          description {                                                  \
151             state: "default" 0.0;                                       \
152             color: 255 255 255 255;                                     \
153             color_class: "primary";                                     \
154             rel1 {                                                      \
155                relative: 0.0 rely;                                      \
156                offset: 0 offy;                                          \
157                to_y: relto;                                             \
158             }                                                           \
159             rel2 {                                                      \
160                relative: 1.0 rely;                                      \
161                offset: -1 (offy + SEPARATOR_HEIGHT / 2);                \
162                to_y: relto;                                             \
163             }                                                           \
164          }                                                              \
165       }                                                                 \
166       part {                                                            \
167          name: "separator.bg."##id;                                     \
168          type: RECT;                                                    \
169          mouse_events: 0;                                               \
170          description {                                                  \
171             state: "default" 0.0;                                       \
172             color: 255 255 255 255;                                     \
173             color_class: "bg";                                          \
174             rel1 {                                                      \
175                relative: 0.0 rely;                                      \
176                offset: 0 (offy + SEPARATOR_HEIGHT / 2);                 \
177                to_y: relto;                                             \
178             }                                                           \
179             rel2 {                                                      \
180                relative: 1.0 rely;                                      \
181                offset: -1 (offy + SEPARATOR_HEIGHT);                    \
182                to_y: relto;                                             \
183             }                                                           \
184          }                                                              \
185       }
186
187       SEPARATOR("number", 1.0, 0, "elm.text.contact-and-type");
188       SEPARATOR("actions", 0.0, -SEPARATOR_HEIGHT, "bg.actions");
189 #undef SEPARATOR
190
191
192 #define BUTTON(id, label, sub, ccls, r1, r2)                            \
193       part {                                                            \
194          name: "button."##id;                                           \
195          type: RECT;                                                    \
196          mouse_events: 1;                                               \
197          description {                                                  \
198             state: "default" 0.0;                                       \
199             color: 255 255 255 0;                                       \
200             color_class: "action";                                      \
201             rel1 {                                                      \
202                to: "bg.buttons";                                        \
203                relative: r1;                                            \
204             }                                                           \
205             rel2 {                                                      \
206                to: "bg.buttons";                                        \
207                relative: r2;                                            \
208                offset: -2 -2;                                           \
209             }                                                           \
210          }                                                              \
211          description {                                                  \
212             state: "pressed" 0.0;                                       \
213             inherit: "default" 0.0;                                     \
214             color: 255 255 255 255;                                     \
215          }                                                              \
216       }                                                                 \
217       part {                                                            \
218          name: "label."##id;                                            \
219          type: TEXT;                                                    \
220          mouse_events: 0;                                               \
221          description {                                                  \
222             state: "default" 0.0;                                       \
223             color: 255 255 255 255;                                     \
224             color_class: ccls;                                          \
225             rel1.to: "button."##id;                                     \
226             rel2 {                                                      \
227                to: "button."##id;                                       \
228                relative: 1.0 0.8;                                       \
229             }                                                           \
230             text {                                                      \
231                text: label;                                             \
232                font: FONT_NORMAL;                                       \
233                size: SIZE_LARGE;                                        \
234                align: 0.5 0.5;                                          \
235             }                                                           \
236          }                                                              \
237          description {                                                  \
238             state: "pressed" 0.0;                                       \
239             inherit: "default" 0.0;                                     \
240             color: 16 16 16 255;                                        \
241             color_class: "bg";                                          \
242          }                                                              \
243       }                                                                 \
244       part {                                                            \
245          name: "sub."##id;                                              \
246          type: TEXT;                                                    \
247          mouse_events: 0;                                               \
248          description {                                                  \
249             state: "default" 0.0;                                       \
250             color: 255 255 255 255;                                     \
251             color_class: "secondary";                                   \
252             rel1 {                                                      \
253                to: "button."##id;                                       \
254                relative: 0.0 0.5;                                       \
255                offset: 0 15;                                            \
256             }                                                           \
257             rel2.to: "button."##id;                                     \
258             text {                                                      \
259                text: sub;                                               \
260                font: FONT_BOLD;                                         \
261                size: SIZE_TINY;                                         \
262                align: 0.5 0.5;                                          \
263             }                                                           \
264          }                                                              \
265          description {                                                  \
266             state: "pressed" 0.0;                                       \
267             inherit: "default" 0.0;                                     \
268             color: 16 16 16 255;                                        \
269             color_class: "bg";                                          \
270          }                                                              \
271       }                                                                 \
272       programs {                                                        \
273          program {                                                      \
274             signal: "mouse,up,1";                                       \
275             source: "button."##id;                                      \
276             action: SIGNAL_EMIT "released,"##id "keypad";               \
277             after: "show_up_"##id;                                      \
278             api: id"_released" id" was released";                       \
279          }                                                              \
280          program {                                                      \
281             name: "show_up_"##id;                                       \
282             action: STATE_SET "default" 0.0;                            \
283             transition: DECELERATE 0.1;                                 \
284             target: "button."##id;                                      \
285             target: "label."##id;                                       \
286             target: "sub."##id;                                         \
287          }                                                              \
288          program {                                                      \
289             signal: "mouse,down,1";                                     \
290             source: "button."##id;                                      \
291             after: "show_down_"##id;                                    \
292             action: SIGNAL_EMIT "pressed,"##id "keypad";                \
293             api: id"_pressed" id" was pressed";                         \
294          }                                                              \
295          program {                                                      \
296             name: "show_down_"##id;                                     \
297             action: STATE_SET "pressed" 0.0;                            \
298             transition: ACCELERATE 0.3;                                 \
299             target: "button."##id;                                      \
300             target: "label."##id;                                       \
301             target: "sub."##id;                                         \
302          }                                                              \
303          program {                                                      \
304             signal: "mouse,clicked,1";                                  \
305             source: "button."##id;                                      \
306             action: SIGNAL_EMIT "clicked,"##id "keypad";                \
307             api: id"_clicked" id" was clicked";                         \
308          }                                                              \
309          program {                                                      \
310             signal: "mouse,down,1,double";                              \
311             source: "button."##id;                                      \
312             script {                                                    \
313                emit("pressed,"##id, "keypad");                          \
314             }                                                           \
315          }                                                              \
316          program {                                                      \
317             signal: "mouse,down,1,triple";                              \
318             source: "button."##id;                                      \
319             script {                                                    \
320                emit("pressed,"##id, "keypad");                          \
321             }                                                           \
322          }                                                              \
323       }
324
325       BUTTON("1",    "1",     "", "action", 0.000 0.0, 0.333 0.25);
326       BUTTON("2",    "2",  "ABC", "action", 0.333 0.0, 0.666 0.25);
327       BUTTON("3",    "3",  "DEF", "action", 0.666 0.0, 1.000 0.25);
328
329       BUTTON("4",    "4",  "GHI", "action", 0.000 0.25, 0.333 0.50);
330       BUTTON("5",    "5",  "JKL", "action", 0.333 0.25, 0.666 0.50);
331       BUTTON("6",    "6",  "MNO", "action", 0.666 0.25, 1.000 0.50);
332
333       BUTTON("7",    "7", "PQRS", "action", 0.000 0.50, 0.333 0.75);
334       BUTTON("8",    "8",  "TUV", "action", 0.333 0.50, 0.666 0.75);
335       BUTTON("9",    "9", "WXYZ", "action", 0.666 0.50, 1.000 0.75);
336
337       BUTTON("star", "*",     "", "secondary",  0.000 0.75, 0.333 1.00);
338       BUTTON("0",    "0",    "+", "action", 0.333 0.75, 0.666 1.00);
339       BUTTON("hash", "#",     "", "secondary",  0.666 0.75, 1.000 1.00);
340 #undef BUTTON
341
342
343 #define ACTION_BUTTON(id, img, x0, x1)                                  \
344       part {                                                            \
345          name: "clipper."##id;                                          \
346          type: RECT;                                                    \
347          description {                                                  \
348             state: "default" 0.0;                                       \
349             color: 255 255 255 255;                                     \
350          }                                                              \
351          description {                                                  \
352             state: "disabled" 0.0;                                      \
353             inherit: "default" 0.0;                                     \
354             color_class: "disabled";                                    \
355          }                                                              \
356       }                                                                 \
357       part {                                                            \
358          name: "button."##id;                                           \
359          type: RECT;                                                    \
360          mouse_events: 1;                                               \
361          clip_to: "clipper."##id;                                       \
362          description {                                                  \
363             state: "default" 0.0;                                       \
364             color: 255 255 255 0;                                       \
365             color_class: "action";                                      \
366             min: ACTION_WIDTH ACTION_HEIGHT;                            \
367             max: ACTION_WIDTH ACTION_HEIGHT;                            \
368             fixed: 1 1;                                                 \
369             rel1 {                                                      \
370                to: "bg.actions";                                        \
371                relative: x0 0.0;                                        \
372             }                                                           \
373             rel2 {                                                      \
374                to: "bg.actions";                                        \
375                relative: x1 1.0;                                        \
376                offset: -1 -1;                                           \
377             }                                                           \
378          }                                                              \
379          description {                                                  \
380             state: "pressed" 0.0;                                       \
381             inherit: "default" 0.0;                                     \
382             color: 255 255 255 255;                                     \
383          }                                                              \
384       }                                                                 \
385       part {                                                            \
386          name: "button.ico."##id;                                       \
387          type: IMAGE;                                                   \
388          mouse_events: 0;                                               \
389          clip_to: "clipper."##id;                                       \
390          description {                                                  \
391             state: "default" 0.0;                                       \
392             color: 255 255 255 255;                                     \
393             color_class: "action";                                      \
394             min: ACTION_HEIGHT ACTION_HEIGHT;                           \
395             max: ACTION_HEIGHT ACTION_HEIGHT;                           \
396             fixed: 1 1;                                                 \
397             rel1.to: "button."##id;                                     \
398             rel2.to: "button."##id;                                     \
399             image.normal: "ico_"##img".png";                            \
400          }                                                              \
401          description {                                                  \
402             state: "pressed" 0.0;                                       \
403             inherit: "default" 0.0;                                     \
404             color_class: "bg";                                          \
405          }                                                              \
406       }                                                                 \
407       part {                                                            \
408          name: "blocker."##id;                                          \
409          type: RECT;                                                    \
410          mouse_events: 1;                                               \
411          clip_to: "clipper."##id;                                       \
412          description {                                                  \
413             state: "default" 0.0;                                       \
414             color: 0 0 0 0;                                             \
415             visible: 0;                                                 \
416             rel1.to: "button."##id;                                     \
417             rel2.to: "button."##id;                                     \
418          }                                                              \
419          description {                                                  \
420             state: "disabled" 0.0;                                      \
421             inherit: "default" 0.0;                                     \
422             visible: 1;                                                 \
423          }                                                              \
424       }                                                                 \
425       programs {                                                        \
426          program {                                                      \
427             signal: "mouse,up,1";                                       \
428             source: "button."##id;                                      \
429             action: SIGNAL_EMIT "released,"##id "keypad";               \
430             after: "show_up_"##id;                                      \
431             api: id"_released" id" was released";                       \
432          }                                                              \
433          program {                                                      \
434             name: "show_up_"##id;                                       \
435             action: STATE_SET "default" 0.0;                            \
436             transition: DECELERATE 0.1;                                 \
437             target: "button."##id;                                      \
438             target: "button.ico."##id;                                  \
439          }                                                              \
440          program {                                                      \
441             signal: "mouse,down,1";                                     \
442             source: "button."##id;                                      \
443             after: "show_down_"##id;                                    \
444             action: SIGNAL_EMIT "pressed,"##id "keypad";                \
445             api: id"_pressed" id" was pressed";                         \
446          }                                                              \
447          program {                                                      \
448             name: "show_down_"##id;                                     \
449             action: STATE_SET "pressed" 0.0;                            \
450             transition: ACCELERATE 0.1;                                 \
451             target: "button."##id;                                      \
452             target: "button.ico."##id;                                  \
453          }                                                              \
454          program {                                                      \
455             signal: "mouse,clicked,1";                                  \
456             source: "button."##id;                                      \
457             action: SIGNAL_EMIT "clicked,"##id "keypad";                \
458             api: id"_clicked" id" was clicked";                         \
459          }                                                              \
460          program {                                                      \
461             signal: "disable,"##id;                                     \
462             source: "keypad";                                           \
463             action: STATE_SET "disabled" 0.0;                           \
464             target: "blocker."##id;                                     \
465             target: "clipper."##id;                                     \
466             api: id"_disable" "disable "##id;                           \
467          }                                                              \
468          program {                                                      \
469             signal: "enable,"##id;                                      \
470             source: "keypad";                                           \
471             action: STATE_SET "default" 0.0;                            \
472             target: "blocker."##id;                                     \
473             target: "clipper."##id;                                     \
474             api: id"_enable" "enable "##id;                             \
475          }                                                              \
476       }
477
478       ACTION_BUTTON("save",      "add_contact", 0.000000000, 0.333333333);
479       ACTION_BUTTON("call",      "call",        0.333333333, 0.666666666);
480       ACTION_BUTTON("backspace", "backspace",   0.666666666, 1.000000000);
481 #undef ACTION_BUTTON
482    }
483
484    programs {
485       program {
486          signal: "show,contact";
487          source: "keypad";
488          action: STATE_SET "show" 0.0;
489          target: "elm.text.contact-and-type";
490       }
491
492       program {
493          signal: "hide,contact";
494          source: "keypad";
495          action: STATE_SET "default" 0.0;
496          target: "elm.text.contact-and-type";
497       }
498    }
499 }