diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/elementary/data/themes/widgets/flipselector.edc | 538 |
1 files changed, 538 insertions, 0 deletions
diff --git a/libraries/elementary/data/themes/widgets/flipselector.edc b/libraries/elementary/data/themes/widgets/flipselector.edc new file mode 100644 index 0000000..39c3117 --- /dev/null +++ b/libraries/elementary/data/themes/widgets/flipselector.edc | |||
@@ -0,0 +1,538 @@ | |||
1 | #define FLIP_PICKER_MAX_LEN (50) | ||
2 | #define FLIP_PICKER_MAX_LEN_STR "50" | ||
3 | |||
4 | group { name: "elm/flipselector/base/default"; | ||
5 | images { | ||
6 | image: "flip_base.png" COMP; | ||
7 | image: "flip_base_shad.png" COMP; | ||
8 | image: "flip_shad.png" COMP; | ||
9 | image: "arrow_up.png" COMP; | ||
10 | image: "arrow_down.png" COMP; | ||
11 | image: "flip_t.png" COMP; | ||
12 | image: "flip_b.png" COMP; | ||
13 | } | ||
14 | |||
15 | data { | ||
16 | item: "max_len" FLIP_PICKER_MAX_LEN_STR; | ||
17 | } | ||
18 | |||
19 | //FIXME: quick successive clicks on, say, up, lead to nastiness | ||
20 | script { | ||
21 | public cur, prev, next, lock; | ||
22 | |||
23 | public animator_bottom_down(val, Float:pos) { | ||
24 | new tmp[FLIP_PICKER_MAX_LEN]; | ||
25 | |||
26 | set_tween_state(PART:"elm.bottom", pos, "shrink", 0.0, "default", 0.0); | ||
27 | set_tween_state(PART:"bottom_sheet", pos, "shrink", 0.0, "default", | ||
28 | 0.0); | ||
29 | set_tween_state(PART:"shadow", pos, "half", 0.0, "full", | ||
30 | 0.0); | ||
31 | |||
32 | if (pos >= 1.0) { | ||
33 | set_state(PART:"shadow", "default", 0.0); | ||
34 | set_int(lock, 0); | ||
35 | |||
36 | fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN); | ||
37 | if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) { | ||
38 | replace_str(next, 0, ""); | ||
39 | message(MSG_STRING, 1, tmp); | ||
40 | } | ||
41 | } | ||
42 | } | ||
43 | |||
44 | public animator_top_down(val, Float:pos) { | ||
45 | set_tween_state(PART:"elm.top", pos, "default", 0.0, "shrink", 0.0); | ||
46 | set_tween_state(PART:"top_sheet", pos, "default", 0.0, "shrink", | ||
47 | 0.0); | ||
48 | set_tween_state(PART:"shadow", pos, "default", 0.0, "half", | ||
49 | 0.0); | ||
50 | |||
51 | if (pos >= 1.0) | ||
52 | anim(0.2, "animator_bottom_down", val); | ||
53 | } | ||
54 | |||
55 | public animator_bottom_up(val, Float:pos) { | ||
56 | set_tween_state(PART:"elm.bottom", pos, "default", 0.0, "shrink", 0.0); | ||
57 | set_tween_state(PART:"bottom_sheet", pos, "default", 0.0, "shrink", | ||
58 | 0.0); | ||
59 | set_tween_state(PART:"shadow", pos, "full", 0.0, "half", | ||
60 | 0.0); | ||
61 | |||
62 | if (pos >= 1.0) | ||
63 | anim(0.2, "animator_top_up", val); | ||
64 | } | ||
65 | |||
66 | public animator_top_up(val, Float:pos) { | ||
67 | new tmp[FLIP_PICKER_MAX_LEN]; | ||
68 | |||
69 | set_tween_state(PART:"elm.top", pos, "shrink", 0.0, "default", 0.0); | ||
70 | set_tween_state(PART:"top_sheet", pos, "shrink", 0.0, "default", | ||
71 | 0.0); | ||
72 | set_tween_state(PART:"shadow", pos, "half", 0.0, "default", | ||
73 | 0.0); | ||
74 | |||
75 | if (pos >= 1.0) { | ||
76 | set_state(PART:"shadow", "default", 0.0); | ||
77 | set_int(lock, 0); | ||
78 | |||
79 | fetch_str(next, 0, tmp, FLIP_PICKER_MAX_LEN); | ||
80 | if (strncmp(tmp, "", FLIP_PICKER_MAX_LEN) != 0) { | ||
81 | replace_str(next, 0, ""); | ||
82 | message(MSG_STRING, 2, tmp); | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | |||
87 | public message(Msg_Type:type, id, ...) { | ||
88 | /* flip down */ | ||
89 | if ((type == MSG_STRING) && (id == 1)) { | ||
90 | new value[FLIP_PICKER_MAX_LEN], tmp[FLIP_PICKER_MAX_LEN]; | ||
91 | |||
92 | snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2)); | ||
93 | |||
94 | if (get_int(lock) == 1) { | ||
95 | replace_str(next, 0, value); | ||
96 | return; | ||
97 | } | ||
98 | |||
99 | fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN); | ||
100 | |||
101 | set_text(PART:"bottom_b", tmp); | ||
102 | |||
103 | set_state(PART:"elm.top", "shrink", 0.0); | ||
104 | set_text(PART:"elm.top", tmp); | ||
105 | set_state(PART:"elm.top", "default", 0.0); | ||
106 | set_text(PART:"elm.top", tmp); | ||
107 | |||
108 | replace_str(prev, 0, tmp); | ||
109 | |||
110 | set_state(PART:"elm.bottom", "default", 0.0); | ||
111 | set_text(PART:"elm.bottom", value); | ||
112 | set_state(PART:"elm.bottom", "shrink", 0.0); | ||
113 | set_text(PART:"elm.bottom", value); | ||
114 | |||
115 | set_text(PART:"top_b", value); | ||
116 | |||
117 | replace_str(cur, 0, value); | ||
118 | |||
119 | set_state(PART:"bottom_sheet", "shrink", 0.0); | ||
120 | set_state(PART:"top_sheet", "default", 0.0); | ||
121 | |||
122 | set_int(lock, 1); | ||
123 | set_state(PART:"shadow", "default", 0.0); | ||
124 | anim(0.2, "animator_top_down", 1); | ||
125 | } | ||
126 | |||
127 | /* flip up */ | ||
128 | if ((type == MSG_STRING) && (id == 2)) { | ||
129 | new value[FLIP_PICKER_MAX_LEN], tmp[FLIP_PICKER_MAX_LEN]; | ||
130 | |||
131 | snprintf(value, FLIP_PICKER_MAX_LEN, "%s", getarg(2)); | ||
132 | |||
133 | if (get_int(lock) == 1) { | ||
134 | replace_str(next, 0, value); | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | fetch_str(cur, 0, tmp, FLIP_PICKER_MAX_LEN); | ||
139 | |||
140 | set_text(PART:"top_b", tmp); | ||
141 | |||
142 | set_state(PART:"elm.bottom", "shrink", 0.0); | ||
143 | set_text(PART:"elm.bottom", tmp); | ||
144 | set_state(PART:"elm.bottom", "default", 0.0); | ||
145 | set_text(PART:"elm.bottom", tmp); | ||
146 | |||
147 | replace_str(prev, 0, tmp); | ||
148 | |||
149 | set_state(PART:"elm.top", "default", 0.0); | ||
150 | set_text(PART:"elm.top", value); | ||
151 | set_state(PART:"elm.top", "shrink", 0.0); | ||
152 | set_text(PART:"elm.top", value); | ||
153 | |||
154 | set_text(PART:"bottom_b", value); | ||
155 | |||
156 | replace_str(cur, 0, value); | ||
157 | |||
158 | set_state(PART:"bottom_sheet", "default", 0.0); | ||
159 | set_state(PART:"top_sheet", "shrink", 0.0); | ||
160 | |||
161 | set_int(lock, 1); | ||
162 | set_state(PART:"shadow", "full", 0.0); | ||
163 | anim(0.2, "animator_bottom_up", 1); | ||
164 | } | ||
165 | } | ||
166 | } | ||
167 | |||
168 | parts { | ||
169 | part { name: "shad"; | ||
170 | mouse_events: 0; | ||
171 | description { state: "default" 0.0; | ||
172 | rel1.offset: -4 -4; | ||
173 | rel1.to: "base"; | ||
174 | rel2.offset: 3 3; | ||
175 | rel2.to: "base"; | ||
176 | image { | ||
177 | normal: "flip_base_shad.png"; | ||
178 | border: 8 8 8 8; | ||
179 | } | ||
180 | } | ||
181 | } | ||
182 | |||
183 | part { name: "base"; | ||
184 | scale: 1; | ||
185 | description { state: "default" 0.0; | ||
186 | rel1.offset: 4 4; | ||
187 | rel2.offset: -5 -5; | ||
188 | min: 24 48; | ||
189 | image.normal: "flip_base.png"; | ||
190 | } | ||
191 | } | ||
192 | |||
193 | part { name: "b"; | ||
194 | type: RECT; | ||
195 | mouse_events: 1; | ||
196 | description { state: "default" 0.0; | ||
197 | rel1.to: "base"; | ||
198 | rel1.relative: 0.0 0.5; | ||
199 | rel2.to: "base"; | ||
200 | color: 0 0 0 0; | ||
201 | } | ||
202 | description { state: "hidden" 0.0; | ||
203 | inherit: "default" 0.0; | ||
204 | visible: 0; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | part { name: "t"; | ||
209 | type: RECT; | ||
210 | mouse_events: 1; | ||
211 | description { state: "default" 0.0; | ||
212 | rel1.to: "base"; | ||
213 | rel2.to: "base"; | ||
214 | rel2.relative: 1.0 0.5; | ||
215 | color: 0 0 0 0; | ||
216 | } | ||
217 | description { state: "hidden" 0.0; | ||
218 | inherit: "default" 0.0; | ||
219 | visible: 0; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | part { name: "bottom_sheet_static"; | ||
224 | mouse_events: 0; | ||
225 | description { state: "default" 0.0; | ||
226 | visible: 1; | ||
227 | rel1.to: "b"; | ||
228 | rel2.to: "b"; | ||
229 | image.normal: "flip_b.png"; | ||
230 | } | ||
231 | } | ||
232 | |||
233 | part { name: "bottom_b"; | ||
234 | mouse_events: 0; | ||
235 | clip_to: "bottom_clipper"; | ||
236 | type: TEXT; | ||
237 | scale: 1; | ||
238 | description { state: "default" 0.0; | ||
239 | rel1.to: "base"; | ||
240 | rel2.to: "base"; | ||
241 | color: 0 0 0 255; | ||
242 | color2: 0 0 0 255; | ||
243 | text { | ||
244 | font: "Sans:style=Bold,Edje-Vera-Bold"; | ||
245 | size: 30; | ||
246 | min: 1 1; | ||
247 | align: 0.5 0.5; | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
252 | part { name: "shadow"; | ||
253 | mouse_events: 0; | ||
254 | description { state: "default" 0.0; | ||
255 | rel1.to: "b"; | ||
256 | rel2.to: "b"; | ||
257 | rel2.relative: 1.0 0.0; | ||
258 | image.normal: "flip_shad.png"; | ||
259 | } | ||
260 | description { state: "half" 0.0; | ||
261 | inherit: "default" 0.0; | ||
262 | rel2.relative: 1.0 0.5; | ||
263 | } | ||
264 | description { state: "full" 0.0; | ||
265 | inherit: "default" 0.0; | ||
266 | rel2.relative: 1.0 1.0; | ||
267 | } | ||
268 | } | ||
269 | |||
270 | part { name: "bottom_sheet"; | ||
271 | mouse_events: 0; | ||
272 | description { state: "default" 0.0; | ||
273 | visible: 1; | ||
274 | rel1.to: "b"; | ||
275 | rel2.to: "b"; | ||
276 | image.normal: "flip_b.png"; | ||
277 | } | ||
278 | description { state: "shrink" 0.0; | ||
279 | inherit: "default" 0.0; | ||
280 | visible: 0; | ||
281 | rel2.relative: 1.0 0.0; | ||
282 | } | ||
283 | } | ||
284 | |||
285 | part { name: "elm.bottom"; | ||
286 | mouse_events: 0; | ||
287 | clip_to: "bottom_clipper"; | ||
288 | type: TEXT; | ||
289 | scale: 1; | ||
290 | description { state: "default" 0.0; | ||
291 | rel1.to: "base"; | ||
292 | rel2.to: "base"; | ||
293 | color: 0 0 0 255; | ||
294 | color2: 0 0 0 255; | ||
295 | text { | ||
296 | font: "Sans:style=Bold,Edje-Vera-Bold"; | ||
297 | size: 30; | ||
298 | min: 1 1; | ||
299 | align: 0.5 0.5; | ||
300 | } | ||
301 | } | ||
302 | description { state: "shrink" 0.0; | ||
303 | inherit: "default" 0.0; | ||
304 | color: 128 128 128 255; | ||
305 | visible: 0; | ||
306 | rel2.relative: 1.0 0.5; /* FIXME: same visual effect? --> MAP! */ | ||
307 | } | ||
308 | } | ||
309 | |||
310 | part { name: "top_sheet_static"; | ||
311 | mouse_events: 0; | ||
312 | description { state: "default" 0.0; | ||
313 | visible: 1; | ||
314 | rel1.to: "t"; | ||
315 | rel2.to: "t"; | ||
316 | image.normal: "flip_t.png"; | ||
317 | } | ||
318 | } | ||
319 | |||
320 | part { name: "top_b"; | ||
321 | mouse_events: 0; | ||
322 | clip_to: "top_clipper"; | ||
323 | type: TEXT; | ||
324 | scale: 1; | ||
325 | description { state: "default" 0.0; | ||
326 | rel1.to: "base"; | ||
327 | rel2.to: "base"; | ||
328 | color: 0 0 0 255; | ||
329 | color2: 0 0 0 255; | ||
330 | text { | ||
331 | font: "Sans:style=Bold,Edje-Vera-Bold"; | ||
332 | size: 30; | ||
333 | min: 1 1; | ||
334 | align: 0.5 0.5; | ||
335 | source: "elm.top"; | ||
336 | } | ||
337 | } | ||
338 | } | ||
339 | |||
340 | part { name: "top_sheet"; | ||
341 | mouse_events: 0; | ||
342 | description { state: "default" 0.0; | ||
343 | visible: 1; | ||
344 | rel1.to: "t"; | ||
345 | rel2.to: "t"; | ||
346 | image.normal: "flip_t.png"; | ||
347 | } | ||
348 | description { state: "shrink" 0.0; | ||
349 | inherit: "default" 0.0; | ||
350 | color: 128 128 128 255; | ||
351 | visible: 0; | ||
352 | rel1.relative: 0.0 1.0; | ||
353 | } | ||
354 | } | ||
355 | |||
356 | part { name: "elm.top"; | ||
357 | mouse_events: 0; | ||
358 | clip_to: "top_clipper"; | ||
359 | type: TEXT; | ||
360 | scale: 1; | ||
361 | description { state: "default" 0.0; | ||
362 | rel1.to: "base"; | ||
363 | rel2.to: "base"; | ||
364 | color: 0 0 0 255; | ||
365 | color2: 0 0 0 255; | ||
366 | text { | ||
367 | font: "Sans:style=Bold,Edje-Vera-Bold"; | ||
368 | size: 30; | ||
369 | min: 1 1; | ||
370 | align: 0.5 0.5; | ||
371 | } | ||
372 | } | ||
373 | description { state: "shrink" 0.0; | ||
374 | inherit: "default" 0.0; | ||
375 | visible: 0; | ||
376 | rel1.relative: 0.0 0.5; | ||
377 | } | ||
378 | } | ||
379 | |||
380 | part { name: "arrow_top"; | ||
381 | mouse_events: 0; | ||
382 | clip_to: "disclip"; | ||
383 | scale: 1; | ||
384 | description { state: "default" 0.0; | ||
385 | min: 15 15; | ||
386 | max: 15 15; | ||
387 | align: 0.5 0.0; | ||
388 | rel1.to: "t"; | ||
389 | rel2.to: "t"; | ||
390 | image.normal: "arrow_up.png"; | ||
391 | } | ||
392 | description { state: "hidden" 0.0; | ||
393 | inherit: "default" 0.0; | ||
394 | visible: 0; | ||
395 | } | ||
396 | } | ||
397 | part { name: "arrow_bottom"; | ||
398 | mouse_events: 0; | ||
399 | clip_to: "disclip"; | ||
400 | scale: 1; | ||
401 | description { state: "default" 0.0; | ||
402 | min: 15 15; | ||
403 | max: 15 15; | ||
404 | align: 0.5 1.0; | ||
405 | rel1.to: "b"; | ||
406 | rel2.to: "b"; | ||
407 | image.normal: "arrow_down.png"; | ||
408 | } | ||
409 | description { state: "hidden" 0.0; | ||
410 | inherit: "default" 0.0; | ||
411 | visible: 0; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | part { | ||
416 | type: RECT; | ||
417 | mouse_events: 0; | ||
418 | name: "top_clipper"; | ||
419 | clip_to: "disclip"; | ||
420 | description { | ||
421 | state: "default" 0.0; | ||
422 | rel1.to: "t"; | ||
423 | rel2.to: "t"; | ||
424 | visible: 1; | ||
425 | } | ||
426 | } | ||
427 | |||
428 | part { | ||
429 | type: RECT; | ||
430 | mouse_events: 0; | ||
431 | name: "bottom_clipper"; | ||
432 | clip_to: "disclip"; | ||
433 | description { | ||
434 | state: "default" 0.0; | ||
435 | rel1.to: "b"; | ||
436 | rel2.to: "b"; | ||
437 | visible: 1; | ||
438 | } | ||
439 | } | ||
440 | |||
441 | part { | ||
442 | type: RECT; | ||
443 | name: "disclip"; | ||
444 | description { | ||
445 | state: "default" 0.0; | ||
446 | color: 255 255 255 255; | ||
447 | } | ||
448 | description { | ||
449 | state: "enabled" 0.0; | ||
450 | color: 100 100 100 100; | ||
451 | } | ||
452 | } | ||
453 | |||
454 | part { | ||
455 | type: RECT; | ||
456 | name: "event_blocker"; | ||
457 | description { | ||
458 | state: "default" 0.0; | ||
459 | color: 0 0 0 0; | ||
460 | visible: 0; | ||
461 | } | ||
462 | description { | ||
463 | state: "enabled" 0.0; | ||
464 | inherit: "default" 0.0; | ||
465 | visible: 1; | ||
466 | } | ||
467 | } | ||
468 | |||
469 | } | ||
470 | |||
471 | programs { | ||
472 | program { name: "load"; | ||
473 | signal: "load"; | ||
474 | source: ""; | ||
475 | script { | ||
476 | append_str(cur, ""); | ||
477 | append_str(prev, ""); | ||
478 | append_str(next, ""); | ||
479 | set_int(lock, 0); | ||
480 | } | ||
481 | } | ||
482 | |||
483 | program { name: "hide_arrows"; | ||
484 | signal: "elm,state,button,hidden"; | ||
485 | source: "elm"; | ||
486 | action: STATE_SET "hidden" 0.0; | ||
487 | target: "arrow_top"; | ||
488 | target: "arrow_bottom"; | ||
489 | target: "t"; | ||
490 | target: "b"; | ||
491 | } | ||
492 | |||
493 | program { name: "show_arrows"; | ||
494 | signal: "elm,state,button,visible"; | ||
495 | source: "elm"; | ||
496 | action: STATE_SET "default" 0.0; | ||
497 | target: "arrow_top"; | ||
498 | target: "arrow_bottom"; | ||
499 | target: "t"; | ||
500 | target: "b"; | ||
501 | } | ||
502 | |||
503 | program { name: "up"; | ||
504 | signal: "mouse,down,1"; | ||
505 | source: "t"; | ||
506 | action: SIGNAL_EMIT "elm,action,up,start" ""; | ||
507 | } | ||
508 | program { name: "up,stop"; | ||
509 | signal: "mouse,up,1"; | ||
510 | source: "t"; | ||
511 | action: SIGNAL_EMIT "elm,action,up,stop" ""; | ||
512 | } | ||
513 | program { name: "down"; | ||
514 | signal: "mouse,down,1"; | ||
515 | source: "b"; | ||
516 | action: SIGNAL_EMIT "elm,action,down,start" ""; | ||
517 | } | ||
518 | program { name: "down,stop"; | ||
519 | signal: "mouse,up,1"; | ||
520 | source: "b"; | ||
521 | action: SIGNAL_EMIT "elm,action,down,stop" ""; | ||
522 | } | ||
523 | program { name: "disable"; | ||
524 | signal: "elm,state,disabled"; | ||
525 | source: "elm"; | ||
526 | action: STATE_SET "enabled" 0.0; | ||
527 | target: "disclip"; | ||
528 | target: "event_blocker"; | ||
529 | } | ||
530 | program { name: "enable"; | ||
531 | signal: "elm,state,enabled"; | ||
532 | source: "elm"; | ||
533 | action: STATE_SET "default" 0.0; | ||
534 | target: "disclip"; | ||
535 | target: "event_blocker"; | ||
536 | } | ||
537 | } | ||
538 | } | ||