theme cleanup
[profile/ivi/lemolo.git] / data / themes / includes / history.edc
1 group {
2    name: "elm/layout/dialer/history/img";
3
4    parts {
5       part {
6          name: "rect";
7          type: RECT;
8          description {
9             state: "default" 0.0;
10             min: LIST_ICON_SIZE LIST_ICON_SIZE;
11             max: LIST_ICON_SIZE LIST_ICON_SIZE;
12             color: 0 0 0 0;
13          }
14       }
15    }
16    programs {
17       program {
18          signal: "mouse,clicked,1";
19          source: "rect";
20          action: SIGNAL_EMIT "clicked,more" "gui";
21       }
22    }
23 }
24
25 group {
26    name: "elm/genlist/item/history/default";
27
28    data {
29       item: "texts" "text.call.name text.call.time text.call.type";
30       item: "contents" "call.swallow.more";
31       item: "states" "missed";
32    }
33
34    script {
35       public missed;
36       public selected;
37       public not_first; /* can't call it 'first' as globals start as 0 */
38
39       public anim_states() {
40          new m = get_int(missed);
41          new s = get_int(selected);
42
43          if (m) {
44             if (s)
45                run_program(PROGRAM:"show_selected");
46             else
47                run_program(PROGRAM:"show_missed");
48          } else {
49             if (s)
50                run_program(PROGRAM:"show_selected");
51             else
52                run_program(PROGRAM:"show_default");
53          }
54       }
55
56       public set_missed(val) {
57          new m = get_int(missed);
58          new s = get_int(selected);
59
60          if (m == val) return;
61          set_int(missed, val);
62          m = val;
63
64          if (get_int(not_first)) {
65             if (m) {
66                if (s)
67                   run_program(PROGRAM:"animate_selected");
68                else
69                   run_program(PROGRAM:"animate_missed");
70             } else {
71                if (s)
72                   run_program(PROGRAM:"animate_selected");
73                else
74                   run_program(PROGRAM:"animate_default");
75             }
76          } else {
77             set_int(not_first, 1);
78             anim_states();
79          }
80       }
81
82       public set_selected(val) {
83          new s = get_int(selected);
84
85          if (s == val) return;
86          set_int(selected, val);
87
88          anim_states();
89       }
90    }
91
92    images {
93       image: "ico_arrow_right.png" COMP;
94       image: "ico_del.png" COMP;
95    }
96
97    parts{
98       part {
99          name: "bg";
100          type: RECT;
101          scale: 1;
102          mouse_events: 1;
103          description {
104             state: "default" 0.0;
105             color: 255 255 255 0;
106             color_class: "action";
107             min: ACTION_WIDTH LIST_ITEM_HEIGHT;
108          }
109          description {
110             state: "selected" 0.0;
111             inherit: "default" 0.0;
112             color: 255 255 255 255;
113          }
114       }
115       part {
116          name: "text.call.name";
117          type: TEXT;
118          scale: 1;
119          mouse_events: 0;
120          description {
121             state: "default" 0.0;
122             color: 255 255 255 255;
123             color_class: "action";
124             rel1 {
125                relative: 0.0 0.0;
126                offset: BORDER_PADDING ITEM_PADDING;
127             }
128             rel2 {
129                to_x: "call.swallow.more";
130                relative: 0.0 0.5;
131                offset: -ITEM_PADDING -1;
132             }
133             text {
134                font: FONT_NORMAL;
135                size: SIZE_MEDIUM;
136                align: 0.0 1.0;
137                ellipsis: 0.0;
138             }
139          }
140          description {
141             state: "missed" 0.0;
142             inherit: "default" 0.0;
143             color_class: "caution";
144          }
145          description {
146             state: "selected" 0.0;
147             inherit: "default" 0.0;
148             color_class: "bg";
149          }
150       }
151
152       part {
153          name: "text.call.time";
154          type: TEXT;
155          scale: 1;
156          mouse_events: 0;
157          description {
158             state: "default" 0.0;
159             color: 255 255 255 128;
160             color_class: "action";
161             rel1 {
162                relative: 0.0 0.5;
163                offset: BORDER_PADDING 0;
164             }
165             rel2 {
166                relative: 0.5 1.0;
167                offset: (-BORDER_PADDING - 1) (-ITEM_PADDING - 1);
168             }
169             text {
170                font: FONT_NORMAL;
171                size: SIZE_SMALL;
172                align: 0.0 0.0;
173                ellipsis: 1.0;
174             }
175          }
176          description {
177             state: "missed" 0.0;
178             inherit: "default" 0.0;
179             color_class: "caution";
180          }
181          description {
182             state: "selected" 0.0;
183             inherit: "default" 0.0;
184             color_class: "bg";
185          }
186       }
187
188       part {
189          name: "text.call.type";
190          type: TEXT;
191          mouse_events: 0;
192          scale: 1;
193          description {
194             state: "default" 0.0;
195             color: 255 255 255 128;
196             color_class: "action";
197             rel1 {
198                relative: 0.5 0.5;
199                offset: 0 0;
200             }
201             rel2 {
202                to_x: "call.swallow.more";
203                relative: 0.0 1.0;
204                offset: (-ITEM_PADDING - ITEM_PADDING) (-ITEM_PADDING - 1);
205             }
206             text {
207                font: FONT_NORMAL;
208                size: SIZE_SMALL;
209                align: 0.0 0.0;
210                ellipsis: 1.0;
211             }
212          }
213          description {
214             state: "missed" 0.0;
215             inherit: "default" 0.0;
216             color_class: "caution";
217          }
218          description {
219             state: "selected" 0.0;
220             inherit: "default" 0.0;
221             color_class: "bg";
222          }
223       }
224
225       part {
226          name: "call.img.more";
227          type: IMAGE;
228          mouse_events: 0;
229          description {
230             state: "default" 0.0;
231             rel1.to: "call.swallow.more";
232             rel2.to: "call.swallow.more";
233             color_class: "action";
234             image {
235                normal: "ico_arrow_right.png";
236                scale_hint: STATIC;
237             }
238          }
239          description {
240             state: "missed" 0.0;
241             inherit: "default" 0.0;
242          }
243          description {
244             state: "selected" 0.0;
245             inherit: "default" 0.0;
246             color_class: "bg";
247          }
248       }
249
250       part {
251          name: "call.swallow.more";
252          type: SWALLOW;
253          mouse_events: 1;
254          description {
255             state: "default" 0.0;
256             min: LIST_ICON_SIZE LIST_ICON_SIZE;
257             max: LIST_ICON_SIZE LIST_ICON_SIZE;
258             align: 1.0 0.5;
259             fixed: 1 1;
260             rel1 {
261                relative: 1.0 0.0;
262                offset: -BORDER_PADDING 0;
263             }
264             rel2 {
265                relative: 1.0 1.0;
266                offset: -BORDER_PADDING -1;
267             }
268          }
269       }
270    }
271
272    programs {
273       program {
274          signal: "elm,state,missed,active";
275          source: "elm";
276          script {
277             set_missed(1);
278          }
279       }
280       program {
281          signal: "elm,state,missed,passive";
282          source: "elm";
283          script {
284             set_missed(0);
285          }
286       }
287       program {
288          signal:  "elm,state,selected";
289          source:  "elm";
290          script {
291             set_selected(1);
292          }
293       }
294       program {
295          signal:  "elm,state,unselected";
296          source:  "elm";
297          script {
298             set_selected(0);
299          }
300       }
301
302       program {
303          name: "show_missed";
304          action: STATE_SET "missed" 0.0;
305          target: "bg";
306          target: "text.call.name";
307          target: "text.call.time";
308          target: "text.call.type";
309          target: "call.img.more";
310       }
311       program {
312          name: "show_default";
313          action: STATE_SET "default" 0.0;
314          target: "bg";
315          target: "text.call.name";
316          target: "text.call.time";
317          target: "text.call.type";
318          target: "call.img.more";
319       }
320       program {
321          name: "show_selected";
322          action: STATE_SET "selected" 0.0;
323          target: "bg";
324          target: "text.call.name";
325          target: "text.call.time";
326          target: "text.call.type";
327          target: "call.img.more";
328       }
329
330       program {
331          name: "animate_missed";
332          action: STATE_SET "missed" 0.0;
333          transition: DECELERATE 0.1;
334          target: "bg";
335          target: "text.call.name";
336          target: "text.call.time";
337          target: "text.call.type";
338          target: "call.img.more";
339       }
340       program {
341          name: "animate_default";
342          action: STATE_SET "default" 0.0;
343          transition: DECELERATE 0.1;
344          target: "bg";
345          target: "text.call.name";
346          target: "text.call.time";
347          target: "text.call.type";
348          target: "call.img.more";
349       }
350       program {
351          name: "animate_selected";
352          action: STATE_SET "selected" 0.0;
353          transition: DECELERATE 0.1;
354          target: "bg";
355          target: "text.call.name";
356          target: "text.call.time";
357          target: "text.call.type";
358          target: "call.img.more";
359       }
360    }
361 }
362
363 group {
364    name: "elm/genlist/item/history-delete/default";
365    alias: "elm/genlist/item_odd/history-delete/default";
366
367    data {
368       item: "contents" "call.swallow.delete";
369       item: "mode_part" "elm.swallow.decorate.content";
370    }
371
372    parts {
373       part {
374          name: "content.clipper";
375          type: RECT;
376          description {
377             state: "default" 0.0;
378          }
379          description {
380             state: "decorated" 0.0;
381             inherit: "default" 0.0;
382             rel2 {
383                offset: (-BORDER_PADDING - LIST_ICON_SIZE - ITEM_PADDING - 1) -1;
384             }
385          }
386       }
387
388       part {
389          name: "elm.swallow.decorate.content";
390          type: SWALLOW;
391          mouse_events: 1;
392          scale: 1;
393          clip_to: "content.clipper";
394          description {
395             state: "default" 0.0;
396          }
397       }
398
399       part {
400          name: "call.swallow.delete";
401          type: SWALLOW;
402          mouse_events: 1;
403          scale: 1;
404          description {
405             state: "default" 0.0;
406             visible: 0;
407             fixed: 1 0;
408             align: 0.0 0.5;
409             rel1 {
410                relative: 1.0 0.0;
411             }
412          }
413          description {
414             state: "decorated" 0.0;
415             inherit: "default" 0.0;
416             visible: 1;
417             align: 1.0 0.5;
418             rel1 {
419                relative: 1.0 0.0;
420                offset: -BORDER_PADDING 0;
421             }
422             rel2 {
423                relative: 1.0 1.0;
424                offset: -BORDER_PADDING -1;
425             }
426          }
427       }
428
429       programs {
430          program {
431             name: "animate_decorated";
432             signal: "elm,state,decorate,enabled,effect";
433             source: "elm";
434             action: STATE_SET "decorated" 0.0;
435             target: "content.clipper";
436             after: "animate_decorated2";
437          }
438          program {
439             name: "animate_decorated2";
440             action: STATE_SET "decorated" 0.0;
441             transition: ACCELERATE 0.15;
442             target: "call.swallow.delete";
443          }
444
445          program {
446             name: "animate_default";
447             signal: "elm,state,decorate,disabled,effect";
448             source: "elm";
449             action: STATE_SET "default" 0.0;
450             transition: ACCELERATE 0.15;
451             target: "call.swallow.delete";
452             after: "animate_default2";
453          }
454          program {
455             name: "animate_default2";
456             action: STATE_SET "default" 0.0;
457             target: "content.clipper";
458          }
459
460          program {
461             signal: "elm,state,decorate,enabled";
462             source: "elm";
463             action: STATE_SET "decorated" 0.0;
464             target: "content.clipper";
465             target: "call.swallow.delete";
466          }
467          program {
468             signal: "elm,state,decorate,disabled";
469             source: "elm";
470             action: STATE_SET "default" 0.0;
471             target: "content.clipper";
472             target: "call.swallow.delete";
473          }
474
475          program {
476             signal: "elm,state,slide,active";
477             source: "elm";
478             after: "animate_decorated";
479          }
480          program {
481             signal: "elm,state,slide,passive";
482             source: "elm";
483             after: "animate_default";
484          }
485       }
486    }
487 }
488
489 group {
490    name: "elm/button/base/history-delete";
491
492    parts {
493       part {
494          name: "area";
495          type: IMAGE;
496          description {
497             state: "default" 0.0;
498             min: LIST_ICON_SIZE LIST_ICON_SIZE;
499             max: LIST_ICON_SIZE LIST_ICON_SIZE;
500             color: 255 255 255 255;
501             color_class: "caution";
502             image {
503                normal: "ico_del.png";
504                scale_hint: STATIC;
505             }
506          }
507          description {
508             state: "pressed" 0.0;
509             inherit: "default" 0.0;
510             color: 255 255 255 128;
511          }
512       }
513    }
514    programs {
515       program {
516          signal: "mouse,down,1";
517          source: "area";
518          action: SIGNAL_EMIT "elm,action,press" "";
519       }
520       program {
521          signal: "mouse,up,1";
522          source: "area";
523          action: SIGNAL_EMIT "elm,action,unpress" "";
524       }
525       program {
526          signal: "mouse,clicked,1";
527          source: "area";
528          action: SIGNAL_EMIT "elm,action,click" "";
529       }
530
531       program {
532          signal: "mouse,up,1";
533          source: "area";
534          action: STATE_SET "default" 0.0;
535          transition: ACCELERATE 0.1;
536          target: "area";
537       }
538
539       program {
540          signal: "mouse,down,1";
541          source: "area";
542          action: STATE_SET "pressed" 0.0;
543          transition: ACCELERATE 0.1;
544          target: "area";
545       }
546    }
547 }