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;
13 public message(Msg_Type:type, id, ...) {
14 if ((type == MSG_FLOAT) && (id == 1)) {
16 new r = 51, g = 153, b = 255;
17 new lr = 255, lg = 0, lb = 0;
21 new Float:val1, Float:val2;
23 val1 = (val - 0.10) / 0.25;
25 r = round((r * val1) + (lr * val2), ROUND);
26 g = round((g * val1) + (lg * val2), ROUND);
27 b = round((b * val1) + (lb * val2), ROUND);
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);
39 part { name: "fade_clip"; type: RECT;
40 description { state: "default" 0.0;
41 color: 255 255 255 255;
43 description { state: "faded" 0.0;
44 color: 128 128 128 255;
47 part { name: "info_clip"; type: RECT;
49 description { state: "default" 0.0;
52 description { state: "visible" 0.0;
53 color: 255 255 255 255;
56 part { name: "pulse_clip"; type: RECT;
58 description { state: "default" 0.0;
59 color: 255 255 255 255;
61 description { state: "faded" 1.0;
62 color: 255 255 255 255;
64 description { state: "faded" 0.0;
65 color: 255 255 255 64;
68 part { name: "fill_region"; type: SPACER;
69 description { state: "default" 0.0;
74 part { name: "pwr"; type: SPACER;
75 description { state: "default" 0.0;
77 rel1.relative: 0.40 0.40;
79 rel2.relative: 0.60 0.60;
80 aspect: 1.0 1.0; aspect_preference: BOTH;
85 part { name: "base"; type: SPACER;
86 description { state: "default" 0.0;
87 aspect: 1.0 1.0; aspect_preference: BOTH;
90 part { name: "shadow";
91 clip_to: "pulse_clip";
92 description { state: "default" 0.0;
97 image.normal: "bat_shadow.png";
101 clip_to: "pulse_clip";
102 description { state: "default" 0.0;
104 rel1.relative: 0.0 1.0;
106 rel2.relative: 1.0 0.0;
107 image.normal: "bat_base.png";
112 clip_to: "pulse_clip";
113 description { state: "default" 0.0;
118 rel2.relative: 1.0 0.0;
119 aspect: (112/24) (112/24); aspect_preference: HORIZONTAL;
121 image.normal: "bat_top0.png";
124 part { name: "bottom";
125 clip_to: "pulse_clip";
126 description { state: "default" 0.0;
131 aspect: (112/12) (112/12); aspect_preference: HORIZONTAL;
133 image.normal: "bat_bottom0.png";
136 part { name: "fill"; mouse_events: 0;
137 clip_to: "pulse_clip";
138 description { state: "default" 0.0;
139 rel1.to: "fill_region";
141 rel2.to: "fill_region";
143 image.normal: "glow_med_white.png";
144 image.border: 10 10 10 10;
145 color: 51 153 255 255;
148 part { name: "top-shine";
149 clip_to: "pulse_clip";
150 description { state: "default" 0.0;
153 image.normal: "bat_top1.png";
156 part { name: "bottom-shine";
157 clip_to: "pulse_clip";
158 description { state: "default" 0.0;
161 image.normal: "bat_bottom1.png";
164 part { name: "shine";
165 clip_to: "pulse_clip";
166 description { state: "default" 0.0;
171 image.normal: "bat_shine.png";
172 image.border: 0 0 7 7;
176 clip_to: "pulse_clip";
177 description { state: "default" 0.0;
179 rel1.relative: (2/5) 0.0;
182 rel2.relative: (3/5) 1.0;
184 image.normal: "glow_med_white.png";
185 image.border: 5 5 5 5;
189 description { state: "visible" 0.0;
190 inherit: "default" 0.0;
195 clip_to: "pulse_clip";
196 description { state: "default" 0.0;
198 rel1.relative: 0.0 (2/5);
201 rel2.relative: 1.0 (3/5);
203 image.normal: "glow_med_white.png";
204 image.border: 5 5 5 5;
208 description { state: "visible" 0.0;
209 inherit: "default" 0.0;
213 part { name: "e.text.reading"; type: TEXT; mouse_events: 0;
215 clip_to: "info_clip";
216 description { state: "default" 0.0;
220 rel2.relative: 1.0 0.0;
224 color_class: "module_label_plain";
225 color3: 255 255 255 255;
226 text { font: "Sans"; size: 8;
229 text_class: "module_small";
233 part { name: "e.text.time"; type: TEXT; mouse_events: 0;
235 clip_to: "info_clip";
236 description { state: "default" 0.0;
238 rel1.relative: 0.0 1.0;
244 color_class: "module_label_plain";
245 color3: 255 255 255 255;
246 text { font: "Sans"; size: 8;
249 text_class: "module_small";
253 part { name: "over"; type: RECT;
254 description { state: "default" 0.0;
261 signal: "mouse,in"; source: "over";
262 action: STATE_SET "visible" 0.0;
263 transition: LINEAR 0.3;
267 signal: "mouse,out"; source: "over";
268 action: STATE_SET "default" 0.0;
269 transition: LINEAR 0.3;
273 signal: "e,state,charging"; source: "e";
274 action: STATE_SET "visible" 0.0;
279 signal: "e,state,discharging"; source: "e";
280 action: STATE_SET "default" 0.0;
285 signal: "e,state,unknown"; source: "e";
286 action: STATE_SET "faded" 0.0;
289 program { name: "pulse";
290 signal: "e,action,pulse,start"; source: "e";
291 action: STATE_SET "faded" 0.0;
292 transition: ACCELERATE 0.3;
294 target: "pulse_clip";
296 program { name: "pulse2";
297 action: STATE_SET "faded" 1.0; transition: ACCELERATE 0.1;
298 target: "pulse_clip";
301 signal: "e,action,pulse,stop"; source: "e";
302 action: STATE_SET "default" 0.0;
303 target: "pulse_clip";
308 group { name: "e/modules/battery/popup";
311 part { name: "e.swallow.battery"; type: SWALLOW;
312 description { state: "default" 0.0;
313 aspect: 1.0 1.0; aspect_preference: VERTICAL;
319 part { name: "e.text.title"; type: TEXT;
320 effect: SHADOW BOTTOM;
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!";
331 text_class: "module_large";
335 part { name: "e.text.label"; type: TEXT;
336 effect: SHADOW BOTTOM;
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.";
346 text_class: "module_normal";