tizen 2.4 release
[framework/uifw/elementary.git] / data / themes / edc / battery.edc
1 group { name: "e/modules/battery/main";
2    images.image: "bat_shadow.png" COMP;
3    images.image: "bat_base.png" COMP;
4    images.image: "bat_shine.png" COMP;
5    images.image: "bat_bottom0.png" COMP;
6    images.image: "bat_bottom1.png" COMP;
7    images.image: "bat_top0.png" COMP;
8    images.image: "bat_top1.png" COMP;
9    images.image: "glow_med_white.png" COMP;
10    min: 16 16;
11    max: 160 160;
12    script {
13       public message(Msg_Type:type, id, ...) {
14          if ((type == MSG_FLOAT) && (id == 1)) {
15             new Float:val;
16             new r = 51, g = 153, b = 255;
17             new lr = 255, lg = 0, lb = 0;
18             
19             val = getfarg(2);
20             if (val < 0.35) {
21                new Float:val1, Float:val2;
22                
23                val1 = (val - 0.10) / 0.25;
24                val2 = 1.0 - val1;
25                r = round((r * val1) + (lr * val2), ROUND);
26                g = round((g * val1) + (lg * val2), ROUND);
27                b = round((b * val1) + (lb * val2), ROUND);
28             } 
29             custom_state(PART:"fill", "default", 0.0);
30             set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
31             set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
32             set_state_val(PART:"fill", STATE_COLOR, r, g, b, 255);
33             set_state_val(PART:"fill", STATE_REL1, 0.0, 1.0 - val);
34             set_state(PART:"fill", "custom", 0.0);
35          }
36       }
37    }
38    parts {
39       part { name: "fade_clip"; type: RECT;
40          description { state: "default" 0.0;
41             color: 255 255 255 255;
42          }
43          description { state: "faded" 0.0;
44             color: 128 128 128 255;
45          }
46       }
47       part { name: "info_clip"; type: RECT;
48          clip_to: "fade_clip";
49          description { state: "default" 0.0;
50             color: 255 255 255 0;
51          }
52          description { state: "visible" 0.0;
53             color: 255 255 255 255;
54          }
55       }
56       part { name: "pulse_clip"; type: RECT;
57          clip_to: "fade_clip";
58          description { state: "default" 0.0;
59             color: 255 255 255 255;
60          }
61          description { state: "faded" 1.0;
62             color: 255 255 255 255;
63          }
64          description { state: "faded" 0.0;
65             color: 255 255 255 64;
66          }
67       }
68       part { name: "fill_region"; type: SPACER;
69          description { state: "default" 0.0;
70             rel1.to: "bg";
71             rel2.to: "bg";
72          }
73       }
74       part { name: "pwr"; type: SPACER;
75          description { state: "default" 0.0;
76             rel1.to: "bg";
77             rel1.relative: 0.40 0.40;
78             rel2.to: "bg";
79             rel2.relative: 0.60 0.60;
80             aspect: 1.0 1.0; aspect_preference: BOTH;
81             min: 5 5;
82             step: 5 5;
83          }
84       }
85       part { name: "base"; type: SPACER;
86          description { state: "default" 0.0;
87             aspect: 1.0 1.0; aspect_preference: BOTH;
88          }
89       }
90       part { name: "shadow";
91          clip_to: "pulse_clip";
92          description { state: "default" 0.0;
93             rel1.to: "top";
94             rel1.offset: -4 0;
95             rel2.to: "bottom";
96             rel2.offset: 3 3;
97             image.normal: "bat_shadow.png";
98          }
99       }
100       part { name: "bg";
101          clip_to: "pulse_clip";
102          description { state: "default" 0.0;
103             rel1.to: "top";
104             rel1.relative: 0.0 1.0;
105             rel2.to: "bottom";
106             rel2.relative: 1.0 0.0;
107             image.normal: "bat_base.png";
108             fill.smooth: 0;
109          }
110       }
111       part { name: "top";
112          clip_to: "pulse_clip";
113          description { state: "default" 0.0;
114             rel1.to: "base";
115             rel1.offset: 6 4;
116             rel2.to: "base";
117             rel2.offset: -7 4;
118             rel2.relative: 1.0 0.0;
119             aspect: (112/24) (112/24); aspect_preference: HORIZONTAL;
120             align: 0.5 0.0;
121             image.normal: "bat_top0.png";
122          }
123       }
124       part { name: "bottom";
125          clip_to: "pulse_clip";
126          description { state: "default" 0.0;
127             rel1.to: "base";
128             rel1.offset: 6 -5;
129             rel2.to: "base";
130             rel2.offset: -7 -5;
131             aspect: (112/12) (112/12); aspect_preference: HORIZONTAL;
132             align: 0.5 1.0;
133             image.normal: "bat_bottom0.png";
134          }
135       }
136       part { name: "fill"; mouse_events: 0;
137          clip_to: "pulse_clip";
138          description { state: "default" 0.0;
139             rel1.to: "fill_region";
140             rel1.offset: -5 -5;
141             rel2.to: "fill_region";
142             rel2.offset: 4 4;
143             image.normal: "glow_med_white.png";
144             image.border: 10 10 10 10;
145             color: 51 153 255 255;
146          }
147       }
148       part { name: "top-shine";
149          clip_to: "pulse_clip";
150          description { state: "default" 0.0;
151             rel1.to: "top";
152             rel2.to: "top";
153             image.normal: "bat_top1.png";
154          }
155       }
156       part { name: "bottom-shine";
157          clip_to: "pulse_clip";
158          description { state: "default" 0.0;
159             rel1.to: "bottom";
160             rel2.to: "bottom";
161             image.normal: "bat_bottom1.png";
162          }
163       }
164       part { name: "shine";
165          clip_to: "pulse_clip";
166          description { state: "default" 0.0;
167             rel1.to: "bg";
168             rel1.offset: 0 -6;
169             rel2.to: "bg";
170             rel2.offset: -1 5;
171             image.normal: "bat_shine.png";
172             image.border: 0 0 7 7;
173          }
174       }
175       part { name: "pwr1";
176          clip_to: "pulse_clip";
177          description { state: "default" 0.0;
178             rel1.to: "pwr";
179             rel1.relative: (2/5) 0.0;
180             rel1.offset: -5 -5;
181             rel2.to: "pwr";
182             rel2.relative: (3/5) 1.0;
183             rel2.offset: 4 4;
184             image.normal: "glow_med_white.png";
185             image.border: 5 5 5 5;
186             fill.smooth: 0;
187             visible: 0;
188          }
189          description { state: "visible" 0.0;
190             inherit: "default" 0.0;
191             visible: 1;
192          }
193       }
194       part { name: "pwr2";
195          clip_to: "pulse_clip";
196          description { state: "default" 0.0;
197             rel1.to: "pwr";
198             rel1.relative: 0.0 (2/5);
199             rel1.offset: -5 -5;
200             rel2.to: "pwr";
201             rel2.relative: 1.0 (3/5);
202             rel2.offset: 4 4;
203             image.normal: "glow_med_white.png";
204             image.border: 5 5 5 5;
205             fill.smooth: 0;
206             visible: 0;
207          }
208          description { state: "visible" 0.0;
209             inherit: "default" 0.0;
210             visible: 1;
211          }
212       }
213       part { name: "e.text.reading"; type: TEXT; mouse_events: 0;
214          scale: 1;
215          clip_to: "info_clip";
216          description { state: "default" 0.0;
217             align: 0.5 0.0;
218             rel1.to: "bg";
219             rel1.offset: 0 -2;
220             rel2.relative: 1.0 0.0;
221             rel2.to_x: "bg";
222             rel2.to_y: "pwr";
223             rel2.offset: -1 2;
224             color_class: "module_label_plain";
225             color3: 255 255 255 255;
226             text { font: "Sans"; size: 8;
227                min: 0 1;
228                fit: 1 1;
229                text_class: "module_small";
230             }
231          }
232       }
233       part { name: "e.text.time"; type: TEXT; mouse_events: 0;
234          scale: 1;
235          clip_to: "info_clip";
236          description { state: "default" 0.0;
237             align: 0.5 1.0;
238             rel1.relative: 0.0 1.0;
239             rel1.offset: 0 -2;
240             rel1.to_x: "bg";
241             rel1.to_y: "pwr";
242             rel2.offset: -1 1;
243             rel2.to: "bg";
244             color_class: "module_label_plain";
245             color3: 255 255 255 255;
246             text { font: "Sans"; size: 8;
247                min: 0 1;
248                fit: 1 1;
249                text_class: "module_small";
250             }
251          }
252       }
253       part { name: "over"; type: RECT;
254          description { state: "default" 0.0;
255             color: 0 0 0 0;
256          }
257       }
258    }
259    programs {
260       program {
261          signal: "mouse,in"; source: "over";
262          action: STATE_SET "visible" 0.0;
263          transition: LINEAR 0.3;
264          target: "info_clip";
265       }
266       program {
267          signal: "mouse,out"; source: "over";
268          action: STATE_SET "default" 0.0;
269          transition: LINEAR 0.3;
270          target: "info_clip";
271       }
272       program {
273          signal: "e,state,charging"; source: "e";
274          action: STATE_SET "visible" 0.0;
275          target: "pwr1";
276          target: "pwr2";
277       }
278       program {
279          signal: "e,state,discharging"; source: "e";
280          action: STATE_SET "default" 0.0;
281          target: "pwr1";
282          target: "pwr2";
283       }
284       program {
285          signal: "e,state,unknown"; source: "e";
286          action: STATE_SET "faded" 0.0;
287          target: "fade_clip";
288       }
289       program { name: "pulse";
290          signal: "e,action,pulse,start"; source: "e";
291          action: STATE_SET "faded" 0.0;
292          transition: ACCELERATE 0.3;
293          after: "pulse2";
294          target: "pulse_clip";
295       }
296       program { name: "pulse2";
297          action: STATE_SET "faded" 1.0; transition: ACCELERATE 0.1;
298          target: "pulse_clip";
299       }
300       program {
301          signal: "e,action,pulse,stop"; source: "e";
302          action: STATE_SET "default" 0.0;
303          target: "pulse_clip";
304       }
305    }
306 }
307
308 group { name: "e/modules/battery/popup";
309    min: 240 60;
310    parts {
311       part { name: "e.swallow.battery"; type: SWALLOW;
312          description { state: "default" 0.0;
313             aspect: 1.0 1.0; aspect_preference: VERTICAL;
314             min: 1 1;
315             max: 160 160;
316             align: 0.0 0.5;
317          }
318       }
319       part { name: "e.text.title"; type: TEXT;
320          effect: SHADOW BOTTOM;
321          scale: 1;
322          description { state: "default" 0.0;
323             rel1.relative: 1.0 0.0;
324             rel1.to_x: "e.swallow.battery";
325             rel2.relative: 1.0 0.5;
326             color: FN_COL_DEFAULT;
327             text { font: "Sans:style=Bold"; size: 10;
328                text: "Your battery is low!";
329                min: 1 1;
330                ellipsis: -1;
331                text_class: "module_large";
332             }
333          }
334       }
335       part { name: "e.text.label"; type: TEXT;
336          effect: SHADOW BOTTOM;
337          scale: 1;
338          description { state: "default" 0.0;
339             rel1.relative: 1.0 0.5;
340             rel1.to_x: "e.swallow.battery";
341             color: FN_COL_DEFAULT;
342             text { font: "Sans"; size: 10;
343                text: "AC power is recommended.";
344                min: 1 1;
345                ellipsis: -1;
346                text_class: "module_normal";
347             }
348          }
349       }
350    }
351 }