Honour awake status to restore backlight
[mokosuite2:appbunch.git] / data / themes / gry / home.edc
1 #define HANDLE_HEIGHT   (52*SCALE_FACTOR)
2 #define HANDLE_OFFSET   (6*SCALE_FACTOR)
3 #define SCREEN_WIDTH    (240*SCALE_FACTOR)
4
5 group { name: "elm/scroller/base/desktop";
6   parts {
7         part { name: "bg";
8         type: RECT;
9         description { state: "default" 0.0;
10         color: 255 255 255 0;
11         }
12     }
13     part { name: "clipper";
14         type: RECT;
15         mouse_events: 0;
16         description { state: "default" 0.0;
17         rel1.to: "bg";
18         rel2.to: "bg";
19         }
20     }
21     part { name: "elm.swallow.content";
22         clip_to: "clipper";
23         type: SWALLOW;
24         description { state: "default" 0.0;
25         }
26     }
27   }
28 }
29
30 group { name: "widgets";
31     images {
32         image: "tray_handle_normal.png" COMP;
33         image: "tray_handle_pressed.png" COMP;
34         image: "tray_collapse.png" COMP;
35         image: "tray_expand.png" COMP;
36     }
37
38     parts {
39
40         part { name: "wallpaper";
41             type: SWALLOW;
42             mouse_events: 0;
43             repeat_events: 1;
44             description {
45                 state: "default" 0.0;
46             }
47         }
48
49         part { name: "widgets";
50             type: SWALLOW;
51             mouse_events: 1;
52             description {
53                 state: "default" 0.0;
54                 rel1 {
55                     relative: 0.0 0.0;
56                     offset: 0 (30*SCALE_FACTOR);
57                 }
58                 rel2 {
59                     relative: 1.0 1.0;
60                 }
61             }
62         }
63     }
64
65 }
66
67
68 group { name: "home";
69     images {
70         image: "tray_handle_normal.png" COMP;
71         image: "tray_handle_pressed.png" COMP;
72         image: "tray_collapse.png" COMP;
73         image: "tray_expand.png" COMP;
74     }
75
76     parts {
77
78         part { name: "widgets";
79             type: SWALLOW;
80             mouse_events: 1;
81             description {
82                 state: "default" 0.0;
83             }
84         }
85
86         part { name: "handle_constraint";
87             type: RECT;
88             mouse_events: 0;
89             description {
90                 state: "default" 0.0;
91                 min: SCREEN_WIDTH HANDLE_HEIGHT;
92                 rel1 {
93                     relative: 0.0 0.0;
94                     offset: 0 (35*SCALE_FACTOR);
95                 }
96                 rel2 {
97                     relative: 1.0 1.0;
98                     offset: 0 HANDLE_OFFSET;
99                 }
100                 color: 0 0 0 0;
101             }
102         }
103
104         part { name: "handle";
105             type: IMAGE;
106             mouse_events: 1;
107             dragable {
108                 confine: "handle_constraint";
109                 events: "handle";
110                 x: 0 0 0;
111                 y: 1 1 0;
112             }
113             description {
114                 state: "default" 0.0;
115                 min: SCREEN_WIDTH HANDLE_HEIGHT;
116                 fixed: 1 1;
117                 image { normal: "tray_handle_normal.png"; }
118                 rel1 {
119                     to: "handle_constraint";
120                     relative: 0.0 1.0;
121                 }
122                 rel2 {
123                     to: "handle_constraint";
124                     relative: 1.0 1.0;
125                 }
126             }
127             description {
128                 state: "pressed" 0.0;
129                 inherit: "default" 0.0;
130                 image { normal: "tray_handle_pressed.png"; }
131             }
132
133         }
134
135         part { name: "handle_direction";
136             type: IMAGE;
137             mouse_events: 0;
138             description {
139                 state: "default" 0.0;
140                 image {
141                     normal: "tray_collapse.png";
142                 }
143                 rel1 {
144                     to: "handle";
145                     relative: 0.5 0.5;
146                     offset: (-10*SCALE_FACTOR) (-10*SCALE_FACTOR);
147                 }
148                 rel2 {
149                     to: "handle";
150                     relative: 0.5 0.5;
151                     offset: (10*SCALE_FACTOR) (10*SCALE_FACTOR);
152                 }
153             }
154             description {
155                 state: "collapsed" 0.0;
156                 inherit: "default" 0.0;
157                 image {
158                     normal: "tray_expand.png";
159                 }
160             }
161         }
162
163         part { name: "applications-bg";
164             type: RECT;
165             mouse_events: 0;
166             description {
167                 state: "default" 0.0;
168                 color: COLOR_DARK_GRAY;
169                 rel1 { to: "applications"; relative: 0.0 0.0; }
170                 rel2 { to: "applications"; relative: 1.0 1.0; }
171             }
172         }
173
174         part { name: "applications";
175             type: SWALLOW;
176             mouse_events: 1;
177             description {
178                 state: "default" 0.0;
179                 rel1 {
180                     to: "handle";
181                     relative: 0.0 0.0;
182                     offset: 0 HANDLE_HEIGHT;
183                 }
184                 rel2 {
185                     to: "handle_constraint";
186                     relative: 1.0 1.0;
187                     offset: 0 -HANDLE_OFFSET;
188                 }
189             }
190         }
191
192     }   // parts
193
194 #define collapse() \
195     set_drag(PART:"handle", 0.0, 1.0); \
196     set_state(PART:"handle_direction", "collapsed", 0.0)
197
198 #define expand() \
199     set_drag(PART:"handle", 0.0, 0.0); \
200     set_state(PART:"handle_direction", "expand", 0.0)
201
202     programs {
203
204         program {
205             name: "signal_collapse";
206             signal: "collapse";
207             source: "handle";
208             script {
209                 collapse();
210             }
211         }
212
213         program {
214             name: "signal_expand";
215             signal: "expand";
216             source: "handle";
217             script {
218                 expand();
219             }
220         }
221
222         program {
223             name: "handle_press";
224             signal: "mouse,down,1";
225             source: "handle";
226             action: STATE_SET "pressed" 0.0;
227             target: "handle";
228         }
229
230         program {
231             name: "handle_release";
232             signal: "mouse,up,1";
233             source: "handle";
234             action: STATE_SET "default" 0.0;
235             target: "handle";
236         }
237
238         program {
239             name: "handle_drag";
240             signal: "mouse,up,1";
241             source: "handle";
242             script {
243                 new Float:dx, Float:dy;
244                 new Float:state_val, state_name[100];
245                 get_drag(PART:"handle", dx, dy);
246                 get_state(PART:"handle_direction", state_name, 100, state_val);
247
248                 if (!strcmp(state_name, "default")) {
249                     if (dy >= 0.2) {
250                         collapse();
251                     } else {
252                         expand();
253                     }
254                 }
255                 else if (!strcmp(state_name, "collapsed")) {
256                     if (dy <= 0.8) {
257                         expand();
258                     } else {
259                         collapse();
260                     }
261                 }
262                 else {
263                     // stato sconosciuto, ripristina collapsed
264                     collapse();
265                 }
266             }
267         }
268
269     } // programs
270
271 }   // group:home
272
273 styles {
274     style { name: "textblock_launcher";
275         //base: "font=Sans font_size=8 align=center color=#fff wrap=word";
276         base: "font=Sans:style=Bold font_size=12 align=center color=#fff wrap=word";
277         tag:  "br" "\n";
278         tag:  "hilight" "+ color=#ffff";
279         tag:  "b" "+ color=#ffff";
280         tag:  "tab" "\t";
281     }
282 }
283
284 group { name: "launcher";
285
286     parts {
287
288         part { name: "bg";
289             clip_to: "disclip";
290             type: RECT;
291             mouse_events: 1;
292             description {
293                 state: "default" 0.0;
294                 rel1 { relative: 0 0; }
295                 rel2 { relative: 1 1; }
296                 color: 0 0 0 0;
297             }
298             description {
299                 state: "selected" 0.0;
300                 inherit: "default" 0.0;
301                 color: COLOR_ORANGE_SOLID;
302             }
303         }
304
305         part { name: "icon";
306             clip_to: "disclip";
307             type: SWALLOW;
308             mouse_events: 0;
309             repeat_events: 1;
310             description {
311                 state: "default" 0.0;
312                 rel1 { relative: 0.05 0.05; }
313                 rel2 { relative: 0.95 0.7; }
314                 aspect: 1 1;
315                 aspect_preference: BOTH;
316             }
317         }
318
319         part { name: "title";
320             clip_to: "disclip";
321             type: TEXTBLOCK;
322             mouse_events: 0;
323             repeat_events: 1;
324             description {
325                 state: "default" 0.0;
326                 rel1 { relative: 0.05 0.7; }
327                 rel2 { relative: 0.95 0.95; }
328                 align: 0.5 0;
329                 text {
330                     style: "textblock_launcher";
331                     min: 0 1;
332                 }
333             }
334         }
335
336         part { name: "disclip";
337             type: RECT;
338             description { 
339                 state: "default" 0.0;
340                 rel1.to: "bg";
341                 rel2.to: "bg";
342             }
343             description { 
344                 state: "disabled" 0.0;
345                 inherit: "default" 0.0;
346                 color: 255 255 255 64;
347             }
348         }
349
350
351     }   // parts
352
353     programs {
354
355         program {
356             name: "launcher_press";
357             signal: "mouse,down,1";
358             source: "bg";
359             action: STATE_SET "selected" 0.0;
360             target: "bg";
361         }
362
363         program {
364             name: "launcher_release";
365             signal: "mouse,up,1";
366             source: "bg";
367             action: STATE_SET "default" 0.0;
368             target: "bg";
369         }
370
371     }   // programs
372
373 }   // group:launcher
374
375 group { name: "widget";
376
377     parts {
378
379         part { name: "widget";
380             type: SWALLOW;
381             mouse_events: 1;
382             //repeat_events: 1;
383             description {
384                 state: "default" 0.0;
385                 rel1.to: "widget_drag";
386                 rel2.to: "widget_drag";
387             }
388         }
389
390         part { name: "widget_drag";
391             type: RECT;
392             mouse_events: 1;
393             //repeat_events: 1;
394             dragable {
395                 //confine: "handle_constraint";
396                 events: "widget_drag";
397                 x: 1 1 0;
398                 y: 1 1 0;
399             }
400             description { 
401                 state: "default" 0.0;
402                 color: 0 0 0 0;
403                 visible: 0;
404             }
405             description { 
406                 state: "visible" 1.0;
407                 inherit: "default" 0.0;
408                 color: 0 0 0 100;
409                 visible: 1;
410             }
411         }
412
413     }   // parts
414
415     programs {
416
417         program {
418             name: "drag_start";
419             signal: "drag_start";
420             source: "widget";
421             action: STATE_SET "visible" 1.0;
422             target: "widget_drag";
423         }
424
425         program {
426             name: "drag_end";
427             signal: "drag_end";
428             source: "widget";
429             action: STATE_SET "default" 0.0;
430             target: "widget_drag";
431         }
432
433     }   // programs
434
435 }   // group: widget