[index]Add active state to button_image & add programs for "elm,indicator,state,activ...
[profile/ivi/efl-theme-tizen.git] / themes / widgets / index.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved 
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of SAMSUNG
7  * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this
8  * software is owned by Samsung and you shall not disclose such Confidential
9  * Information and shall use it only in accordance with the terms of the license
10  * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
11  * representations or warranties about the suitability of the software, either
12  * express or implied, including but not limited to the implied warranties of
13  * merchantability, fitness for a particular purpose, or non-infringement.
14  * SAMSUNG shall not be liable for any damages suffered by licensee arising out
15  * of or releated to this software.
16  *
17  */
18
19    group { name: "elm/index/base/vertical/default";
20       script {
21          public timer_flag;
22          public index_hide_timer(val) {
23             if (get_int(timer_flag) == 1)
24                run_program(PROGRAM:"index0.inactive");
25             return 0;
26          }
27       }
28       images {
29          image: "00_fast_scroll_popup_bg.png" COMP;
30          image: "00_fast_scroll_rollover_bg.png" COMP;
31          image: "00_fast_scroll_rollover_index_1_bg.png" COMP;
32       }
33       data{
34          item: "min_obj_height" "32";
35          item: "min_1st_level_obj_height" "32";
36          item: "special_char" "*";
37       }
38       parts {
39          part { name: "clip";
40             scale: 1;
41             type: RECT;
42             mouse_events:  0;
43             description { state: "default" 0.0;
44                visible:  0;
45                color: 255 255 255 0;
46             }
47             description { state: "active" 0.0;
48                visible:  1;
49                color: 255 255 255 255;
50             }
51          }
52          part { name: "clip2";
53             scale: 1;
54             type: RECT;
55             mouse_events:  0;
56             clip_to: "clip";
57             description { state: "default" 0.0;
58                visible: 0;
59                color: 255 255 255 0;
60             }
61             description { state: "active" 0.0;
62                visible:  1;
63                color: 255 255 255 255;
64             }
65          }
66          part { name: "elm.dragable.index.1";
67             mouse_events: 0;
68             scale: 1;
69             dragable {
70                x: 0 0 0;
71                y: 1 1 0;
72                confine: "elm.swallow.index.0";
73             }
74             description { state: "default" 0.0;
75                fixed: 1 1;
76                min: 20 38;
77                rel1 {
78                   relative: 0.5  0.5;
79                   offset:   0    0;
80                   to: "elm.swallow.index.0";
81                }
82                rel2 {
83                   relative: 0.5  0.5;
84                   offset:   0    0;
85                   to: "elm.swallow.index.0";
86                }
87             }
88          }
89          part { name: "elm.swallow.index.1.padding.right";
90             type: RECT;
91             scale: 1;
92             description { state: "default" 0.0;
93                min: INDEX_LEVEL_PADDING_INC 0;
94                fixed: 1 0;
95                align: 1.0 0.0;
96                rel1 {
97                   relative: 1.0 0.0;
98                   offset: 0 0;
99                }
100                rel2 {
101                   relative: 1.0 0.0;
102                   offset: 0 0;
103                }
104                color: 0 0 0 0;
105             }
106          }
107          part { name: "index.1.bg.image.middle";
108             mouse_events: 0;
109             scale: 1;
110             description { state: "default" 0.0;
111                visible: 0;
112                rel1 {
113                   to: "elm.swallow.index.1";
114                   offset: 0 0;
115                }
116                rel2 {
117                   to: "elm.swallow.index.1";
118                   offset: 0 0;
119                }
120                image {
121                   normal: "00_fast_scroll_rollover_index_1_bg.png";
122                   border: INDEX_BG_NINEPATCH_INC;
123                   border_scale: 1;
124                }
125                fill.smooth: 0;
126             }
127             description { state: "active" 0.0;
128                inherit: "default" 0.0;
129                visible: 1;
130             }
131          }
132          part { name: "elm.swallow.index.1";
133             type: SWALLOW;
134             scale: 1;
135             clip_to: "clip2";
136             description { state: "default" 0.0;
137                align: 0.5 0.5;
138                rel1 {
139                   to_y: "elm.dragable.index.1";
140                   relative: 1.0 0.5;
141                   offset: -1 0;
142                }
143                rel2 {
144                   to_y: "elm.dragable.index.1";
145                   relative: 1.0 0.5;
146                   offset: -1 -1;
147                }
148                color: 255 255 255 0;
149             }
150             description { state: "active" 0.0;
151                inherit: "default" 0.0;
152                rel1 {
153                   to_x: "elm.swallow.index.1.padding.right";
154                   relative: 0.0 0.5;
155                   offset: 0 0;
156                }
157                rel2 {
158                   to_x: "elm.swallow.index.1.padding.right";
159                   relative: 0.0 0.5;
160                   offset: 0 -1;
161                }
162                color: 255 255 255 255;
163             }
164          }
165          part { name: "index.0.bg.image.middle";
166             mouse_events: 0;
167             scale: 1;
168             description { state: "default" 0.0;
169                rel1 {
170                   to: "elm.swallow.index.0";
171                   offset: 0 0;
172                }
173                rel2 {
174                   to: "elm.swallow.index.0";
175                   offset: 0 0;
176                }
177                image {
178                   normal: "00_fast_scroll_rollover_bg.png";
179                   border: INDEX_BG_NINEPATCH_INC;
180                   border_scale: 1;
181                }
182                fill.smooth: 0;
183                visible: 0;
184                }
185             description { state: "active" 0.0;
186                inherit: "default" 0.0;
187                visible: 1;
188             }
189         }
190         part { name: "elm.swallow.index.0";
191             type: SWALLOW;
192             clip_to: "clip";
193             scale: 1;
194             description { state: "default" 0.0;
195                visible: 1;
196                align: 1.0 0.5;
197                rel1 {
198                   relative: 1.0 0.5;
199                   offset: -1 0;
200                }
201                rel2 {
202                   relative: 1.0 0.5;
203                   offset: -1 0;
204                }
205                color: 255 255 255 50;
206             }
207             description { state: "active" 0.0;
208                inherit: "default" 0.0;
209                color: 255 255 255 255;
210             }
211          }
212          part { name: "button_image_padding";
213             mouse_events: 0;
214             scale: 1;
215             clip_to: "clip";
216             type: RECT;
217             description { state: "default" 0.0;
218                align: 0.0 0.0;
219                min: 0 0;
220                max: 0 0;
221                fixed: 0 1;
222                rel1 {
223                   relative: 0.5 0.5;
224                   offset: 0 0;
225                }
226                rel2 {
227                   relative: 0.5 0.5;
228                   offset: 0 0;
229                }
230             }
231          }
232          part { name: "button_image";
233             scale: 1;
234             clip_to: "clip";
235             description { state: "default" 0.0;
236                align: 0.5 0.5;
237                min: INDEX_1ST_LEVEL_POPUP_WIDTH_INC INDEX_POPUP_HEIGHT_INC;
238                fixed: 1 1;
239                rel1 {
240                   to: "elm.text";
241                   relative: 0.0 0.0;
242                   offset: -10 0;
243                }
244                rel2 {
245                   to: "elm.text";
246                   relative: 1.067 1.083;
247                   offset: 10 0;
248                }
249                image {
250                   normal: "00_fast_scroll_popup_bg.png";
251                   border: INDEX_POPUP_BG_NINEPATCH_INC;
252                   border_scale: 1;
253                }
254                image.middle: 1;
255             }
256             description { state: "invisible" 0.0;
257                inherit: "default" 0.0;
258                visible: 0;
259             }
260             description { state: "index1" 0.0;
261                inherit: "default" 0.0;
262                min: INDEX_2ND_LEVEL_POPUP_WIDTH_INC INDEX_POPUP_HEIGHT_INC;
263             }
264             description { state: "active" 0.0;
265                inherit: "default" 0.0;
266                visible: 1;
267             }
268          }
269          part {
270             name: "elm.text";
271             type: "TEXT";
272             mouse_events: 0;
273             scale: 1;
274             clip_to: "clip";
275             description {
276                state: "default" 0.0;
277                align: 0.5 0.5;
278                fixed: 1 1;
279                min: 40 20;
280                visible: 0;
281                rel1 {
282                   to_y: "button_image_padding";
283                   relative: 0.5 1.0;
284                }
285                rel2 {
286                   to_y: "button_image_padding";
287                   relative: 0.5 1.0;
288                }
289                color: INDEX_POPUP_TEXT_COLOR_INC;
290                color3: 0 0 0 64;
291                text {
292                   font: "SLP:style=Medium";
293                   size: INDEX_POPUP_TEXT_SIZE_INC;
294                   min: 1 1;
295                }
296             }
297             description { state: "active" 0.0;
298                inherit: "default" 0.0;
299                visible: 1;
300             }
301          }
302          part { name: "elm.dragable.pointer";
303             type: RECT;
304             scale: 1;
305             mouse_events: 0;
306             dragable {
307                x: 1 1 0;
308                y: 1 1 0;
309             }
310             clip_to: "clip";
311             description { state: "default" 0.0;
312                fixed: 1 1;
313                min: 8 8;
314                max: 8 8;
315                rel1 {
316                   relative: 0.0 0.0;
317                   offset:   0 0;
318                }
319                rel2 {
320                   relative: 0.0 0.0;
321                   offset:   0 0;
322                }
323                color: 0 0 0 0;
324             }
325          }
326          part { name: "elm.swallow.event.0.bottom.padding";
327             type: RECT;
328             scale: 1;
329             description { state: "default" 0.0;
330                min: 0 SOFTKEY_H;
331                fixed: 0 1;
332                align: 0.5 1.0;
333                rel1{
334                   relative: 1.0 1.0; offset: 0 0;
335                }
336                color: 0 0 0 0;
337             }
338          }
339          part { name: "elm.swallow.event.0";
340             type: SWALLOW;
341             scale: 1;
342             description { state: "default" 0.0;
343                fixed: 1 1;
344                align: 1.0 0.5;
345                rel1 {
346                   relative: 1.0 0.0;
347                   offset: -1 0;
348                }
349                rel2 {
350                   relative: 1.0 0.0;
351                   offset: -1 -1;
352                   to_y: "elm.swallow.event.0.bottom.padding";
353                }
354             }
355          }
356          part { name: "elm.swallow.event.1";
357             type: SWALLOW;
358             scale: 1;
359             description { state: "default" 0.0;
360                align: 1.0 0.5;
361                fixed: 1 1;
362                rel1 {
363                   to: "elm.swallow.index.1";
364                   relative: 0.0 0.0;
365                   offset: -1 0;
366                }
367                rel2 {
368                   to: "elm.swallow.index.1";
369                   relative: 0.0 1.0;
370                   offset: -1 -1;
371                }
372             }
373          }
374       }
375       programs {
376          program { name: "load";
377             signal: "load";
378             source: "";
379             script {
380                run_program(PROGRAM:"initial.index0.active");
381                run_program(PROGRAM:"button.image.hidden");
382                timer(2.0, "index_hide_timer", 0);
383             }
384          }
385          program { name: "drag2";
386             signal: "drag,set";
387             source: "elm.dragable.index.1";
388             script {
389                new Float:dx;
390                new Float:dy;
391                get_drag(PART:"elm.dragable.index.1", dx, dy);
392                custom_state(PART:"elm.dragable.index.1", "default", 0.0);
393                set_state_val(PART:"elm.dragable.index.1", STATE_ALIGNMENT, 0.5, dy);
394             }
395          }
396          program { name: "index0.active";
397             signal: "elm,state,active";
398             source: "elm";
399             action: STATE_SET "active" 0.0;
400             transition: DECELERATE 0.3;
401             target: "elm.swallow.index.0";
402             target: "clip";
403             after: "disable_timer";
404          }
405          program { name: "initial.index0.active";
406             action: STATE_SET "active" 0.0;
407             transition: DECELERATE 0.3;
408             target: "elm.swallow.index.0";
409             target: "clip";
410             target: "index.0.bg.image.middle";
411             after: "enable_timer";
412          }
413          program { name: "index0.inactive";
414             signal: "elm,state,inactive";
415             source: "elm";
416             action: STATE_SET "default" 0.0;
417             transition: DECELERATE 0.3;
418             target: "elm.swallow.index.0";
419             target: "clip";
420             target: "index.0.bg.image.middle";
421          }
422          program { name: "index1.inactive";
423             signal: "elm,state,level,0";
424             source: "elm";
425             action: STATE_SET "default" 0.0;
426             transition: DECELERATE 0.3;
427             target: "elm.swallow.index.1";
428             target: "clip2";
429             target: "index.1.bg.image.middle";
430          }
431          program { name: "index1.active";
432             signal: "elm,state,level,1";
433             source: "elm";
434             action: STATE_SET "active" 0.0;
435             transition: DECELERATE 0.3;
436             target: "elm.swallow.index.1";
437             target: "clip2";
438             target: "index.1.bg.image.middle";
439          }
440          program { name: "index.active";
441             signal: "elm,indicator,state,active";
442             source: "elm";
443             action: STATE_SET "active" 0.0;
444             transition: DECELERATE 0.5;
445             target: "clip2";
446             target: "elm.swallow.index.0";
447             target: "clip";
448             target: "index.0.bg.image.middle";
449             target: "elm.text";
450             target: "button_image";
451          }
452          program { name: "index.inactive";
453             signal: "elm,indicator,state,inactive";
454             source: "elm";
455             action: STATE_SET "default" 0.0;
456             transition: DECELERATE 0.5;
457             target: "clip2";
458          }
459          program { name: "button.image.hidden";
460             signal: "elm,state,button,image,hide";
461             source: "elm";
462             action: STATE_SET "invisible" 0.0;
463             target: "button_image";
464          }
465          program { name: "disable_timer";
466             script {
467                set_int(timer_flag, 0);
468             }
469          }
470          program { name: "enable_timer";
471             script {
472                set_int(timer_flag, 1);
473             }
474          }
475       }
476    }
477
478    group { name: "elm/index/item/vertical/default";
479       alias: "elm/index/item_odd/vertical/default";
480       data.item: "stacking" "above";
481       data.item: "selectraise" "on";
482       parts {
483          part { name: "elm.text";
484             type: TEXT;
485             mouse_events: 0;
486             scale: 1;
487             description {
488                min: INDEX_ITEM_WIDTH_INC INDEX_ITEM_HEIGHT_INC;
489                align: 0.5 0.5;
490                state: "default" 0.0;
491                rel1 {
492                   relative: 0.0  0.0;
493                }
494                rel2 {
495                   relative: 1.0  1.0;
496                }
497                color: INDEX_ROLLOVER_TEXT_COLOR_INC;
498                text {
499                   font: "SLP:style=Medium";
500                   size: INDEX_ROLLOVER_TEXT_SIZE_INC;
501                   min: 1 1;
502                   align: 0.5 0.5;
503                }
504             }
505             description { state: "active" 0.0;
506                inherit: "default" 0.0;
507                color: INDEX_ROLLOVER_ACTIVE_TEXT_COLOR_INC;
508             }
509          }
510       }
511       programs {
512          program { name: "active";
513             signal: "elm,state,active";
514             source: "elm";
515             action: STATE_SET "active" 0.0;
516             transition: DECELERATE 1.0;
517             target: "elm.text";
518          }
519          program { name: "inactive";
520             signal: "elm,state,inactive";
521             source: "elm";
522             action: STATE_SET "default" 0.0;
523             transition: DECELERATE 0.1;
524             target: "elm.text";
525          }
526       }
527    }
528    group {
529       name: "elm/index/base/vertical/pagecontrol";
530       alias: "elm/index/base/horizontal/pagecontrol";
531       parts {
532          part { name: "clip";
533             type: RECT;
534             mouse_events:  0;
535             description { state: "default" 0.0;
536                visible:  0;
537                color: 255 255 255 0;
538             }
539             description { state: "active" 0.0;
540                visible:  1;
541                color: 255 255 255 255;
542             }
543          }
544          part { name: "elm.swallow.index.0";
545             type: SWALLOW;
546             scale: 1;
547             clip_to: "clip";
548             description {
549                state: "default" 0.0;
550                align: 0.5 0.5;
551                rel1.relative: 0 0;
552                rel2.relative: 1 1;
553             }
554          }
555          part { name: "elm.swallow.event.0";
556             type: SWALLOW;
557             description { state: "default" 0.0;
558                align: 0.5 0.5;
559             }
560          }
561       }
562       programs {
563          program { name: "active";
564             signal: "elm,state,active";
565             source: "elm";
566             action: STATE_SET "active" 0.0;
567             transition: DECELERATE 0.5;
568             target: "clip";
569          }
570          program { name: "inactive";
571             signal: "elm,state,inactive";
572             source: "elm";
573             action: STATE_SET "default" 0.0;
574             transition: DECELERATE 0.5;
575             target: "clip";
576          }
577       }
578    }
579    group {
580       name: "elm/index/item/vertical/pagecontrol";
581       alias: "elm/index/item_odd/vertical/pagecontrol";
582       alias: "elm/index/item/horizontal/pagecontrol";
583       alias: "elm/index/item_odd/horizontal/pagecontrol";
584       images {
585          image: "00_mainmenu_page_bar_001.png" COMP;
586          image: "00_mainmenu_page_bar_002.png" COMP;
587       }
588       parts {
589          part { name:"bg";
590             type : RECT;
591             scale: 1;
592             description { state: "default" 0.0;
593                min: INDEX_PAGECONTROL_IND_INC;
594                max: INDEX_PAGECONTROL_IND_INC;
595                visible: 0;
596                align: 0.5 0.5;
597             }
598          }
599          part { name: "indicator1";
600             type: IMAGE;
601             mouse_events: 0;
602             scale: 1;
603             description { state: "default" 0.0;
604                align: 0.5 0.5;
605                fixed: 1 1;
606                rel1.to: "bg";
607                rel2.to: "bg";
608                image {
609                   normal: "00_mainmenu_page_bar_001.png";
610                }
611             }
612             description { state: "active" 0.0;
613                inherit: "default" 0.0;
614                visible: 0;
615             }
616          }
617          part { name: "indicator2";
618             type: IMAGE;
619             mouse_events: 0;
620             scale: 1;
621             description { state: "default" 0.0;
622                align: 0.5 0.5;
623                fixed: 1 1;
624                min: INDEX_PAGECONTROL_IND_MIN_INC;
625                max: INDEX_PAGECONTROL_IND_MIN_INC;
626                image.normal: "00_mainmenu_page_bar_002.png";
627                visible: 0;
628             }
629             description { state: "active" 0.0;
630                inherit: "default" 0.0;
631                min: INDEX_PAGECONTROL_IND_INC;
632                max: INDEX_PAGECONTROL_IND_INC;
633                visible: 1;
634             }
635          }
636          part { name: "elm.text";
637             type: TEXT;
638             mouse_events: 0;
639             scale: 1;
640             description { state: "default" 0.0;
641                fixed: 1 1;
642                color: INDEX_PAGECONTROL_FONT_COLOR_INC 0;
643                align: 0.5 0.5;
644                text {
645                   font: "SLP:style=Medium";
646                   size: INDEX_PAGECONTROL_FONT_SIZE_INC;
647                   min: 0 1;
648                   align: 0.5 0.5;
649                }
650                rel1 { to: "indicator2"; }
651                rel2 { to: "indicator2"; }
652             }
653             description { state: "active" 0.0;
654                inherit: "default" 0.0;
655                color: INDEX_PAGECONTROL_FONT_COLOR_INC 255;
656             }
657          }
658       }
659       programs {
660          program { name: "active";
661             signal: "elm,state,active";
662             source: "elm";
663             action: STATE_SET "active" 0.0;
664             target: "indicator1";
665             target: "indicator2";
666             target: "elm.text";
667             transition: LINEAR 0.2;
668          }
669          program { name: "inactive";
670             signal: "elm,state,inactive";
671             source: "elm";
672             action: STATE_SET "default" 0.0;
673             target: "indicator1";
674             target: "indicator2";
675             target: "elm.text";
676             transition: LINEAR 0.2;
677          }
678       }
679    }