tizen 2.3.1 release
[apps/home/settings.git] / resource / setting-slider.edc
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 collections {
23         base_scale: 2.4;
24    #include "tizen-dark-inc.edc"
25    #include "genlist_macro.edc"
26    #include "genlist_textblock_style.edc"
27
28
29    group { name: "elm/slider/horizontal/setting_tap_to_drag";
30       images {
31          image: "00_progress_bg.png" COMP;
32          image: "00_progress_bar.png" COMP;
33                  image: "00_slider_center_point_bg.png" COMP;
34       }
35       script {
36          public invert_on = 0;
37          public set_invert_on() {
38             set_state(PART:"level", "inverted", 0.0);
39             set_state(PART:"level2", "inverted", 0.0);
40             set_int(invert_on, 1);
41          }
42          public set_invert_off() {
43             set_state(PART:"level", "default", 0.0);
44             set_state(PART:"level2", "default", 0.0);
45             set_int(invert_on, 0);
46          }
47          public thumb_down() {
48             if(get_int(invert_on) == 0)
49                set_state(PART:"level", "pressed", 0.0);
50             else if(get_int(invert_on) == 1)
51                set_state(PART:"level2", "pressed", 0.0);
52             }
53          public thumb_up() {
54             if(get_int(invert_on) == 0)
55                set_state(PART:"level", "default", 0.0);
56             else if(get_int(invert_on) == 1)
57                set_state(PART:"level2", "inverted", 0.0);
58             }
59          }
60          parts {
61             part { name: "access";
62                type: RECT;
63                description { state: "default" 0.0;
64                   fixed: 1 1;
65                   color: 8 8 8 8;
66                }
67             }
68             part { name: "base";
69                mouse_events: 0;
70                scale: 1;
71                description { state: "default" 0.0;
72                   min: SLIDER_BASE_MIN_WIDTH_INC SLIDER_BASE_HEIGHT_INC;
73                   max: 99999 SLIDER_BASE_HEIGHT_INC;
74                   rel1 { to: "bg";
75                      offset: 1 0;
76                   }
77                   rel2 { to: "bg";
78                      offset: -5 -1;
79                   }
80                   image.normal: "00_progress_bg.png";
81                   image.border: PROGRESS_BG_IMAGE_BORDER_INC;
82                   image.border_scale: 1;
83                }
84             }
85                          part { name:"center_point";
86                scale: 1;
87                description { state: "default" 0.0;
88                   min: SLIDER_CENTER_POINT_MIN_SIZE_INC;
89                   max: SLIDER_CENTER_POINT_MAX_SIZE_INC;
90                   visible: 0;
91                   image.normal: "00_slider_center_point_bg.png";
92                   rel1.to_y: "center_point_bottom_padding";
93                   rel2 {
94                      relative: 1.0 0.0;
95                      to_y: "center_point_bottom_padding";
96                   }
97                   align: 0.5 1.0;
98                   fixed: 0 1;
99                }
100                description { state: "visible" 0.0;
101                   inherit: "default" 0.0;
102                   visible: 1;
103                }
104             }
105                         part { name: "center_point_bottom_padding";
106                 type: SPACER;
107                 scale: 1;
108                description {
109                   state: "default" 0.0;
110                   min: SLIDER_CENTER_POINT_PADDING_SIZE_INC;
111                   rel1.to: "base";
112                   rel2 {
113                      to: "base";
114                      relative: 1.0 0.0;
115                   }
116                   align: 0.5 1.0;
117                   fixed: 0 1;
118                }
119              }
120             part {
121                name: "bar_image_left_padding";
122                type: SPACER;
123                scale: 1;
124                description {
125                   state: "default" 0.0;
126                   min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
127                   max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
128                   fixed: 1 0;
129                   rel1.to: "base";
130                   rel2 {
131                      relative: 0.0  1.0;
132                      to: "base";
133                   }
134                   align: 0.0 0.5;
135                }
136             }
137             part {
138                name: "bar_image_right_padding";
139                type: SPACER;
140                scale: 1;
141                description {
142                   state: "default" 0.0;
143                   min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
144                   max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
145                   fixed: 1 0;
146                   rel1 {
147                      relative: 1.0  0.0;
148                      to: "base";
149                   }
150                   rel2.to: "base";
151                   align: 1.0 0.5;
152                }
153             }
154             part { name: "level";
155                mouse_events: 0;
156                scale: 1;
157                clip_to: "clipper";
158                description { state: "default" 0.0;
159                   fixed: 1 1;
160                   rel1 {
161                      to_x: "bar_image_left_padding";
162                      to_y: "base";
163                      relative: 1.0 0.0;
164                   }
165                   rel2 {
166                      to_y: "base";
167                      to_x: "elm.dragable.slider";
168                      offset: -5 -1;
169                      relative: 0.5 1.0;
170                   }
171                   image.normal: "00_progress_bar.png";
172                   image.border: PROGRESS_BAR_IMAGE_BORDER_INC;
173                   image.border_scale: 1;
174                }
175                description { state: "inverted" 0.0;
176                   inherit: "default" 0.0;
177                   visible: 0;
178                }
179                description { state: "pressed" 0.0;
180                   inherit: "default" 0.0;
181                }
182             }
183             part { name: "level2";
184                mouse_events: 0;
185                scale: 1;
186                clip_to: "clipper";
187                description { state: "default" 0.0;
188                   fixed: 1 1;
189                   visible: 0;
190                   rel1 {
191                      to_y: "base";
192                      to_x: "elm.dragable.slider";
193                      relative: 0.5 0.0;
194                   }
195                   rel1 {
196                      to_x: "bar_image_right_padding";
197                      to_y: "base";
198                      relative: 0.0 1.0;
199                   }
200                   image.normal: "00_progress_bg.png";
201                   image.border: PROGRESS_BG_IMAGE_BORDER_INC;
202                   image.border_scale: 1;
203                }
204                description { state: "inverted" 0.0;
205                   inherit: "default" 0.0;
206                   visible: 1;
207                }
208                description { state: "pressed" 0.0;
209                   inherit: "default" 0.0;
210                   visible: 1;
211                }
212             }
213             part { name: "bg";
214                type: RECT;
215                scale: 1;
216                description { state: "default" 0.0;
217                   rel1.to: "elm.swallow.bar";
218                   rel2.to: "elm.swallow.bar";
219                   rel2.offset: 3 0;
220                   color: 8 8 8 8;
221                }
222             }
223             part { name: "elm.swallow.bar";
224                type: SWALLOW;
225                scale: 1;
226                description { state: "default" 0.0;
227                   min: SLIDER_SWALLOW_BAR_MIN_WIDTH_INC SLIDER_SWALLOW_BAR_HEIGHT_INC;
228                   max: 99999 SLIDER_SWALLOW_BAR_HEIGHT_INC;
229                   align: 1.0 0.5;
230                   rel1 {
231                      to_x: "bar_left_padding";
232                      relative: 1.0 0.0;
233                   }
234                   rel2 {
235                      to_x: "bar_right_padding";
236                      relative: 0.0 1.0;
237                   }
238                }
239             }
240             part {
241                name: "bar_left_padding";
242                type: SWALLOW;
243                scale: 1;
244                description {
245                   state: "default" 0.0;
246                   visible: 0;
247                   min: 10 0;
248                   fixed: 1 1;
249                   rel1 {
250                      relative: 1.0  0.5;
251                      to_x: "elm.text";
252                   }
253                   rel2 {
254                      relative: 1.0  0.5;
255                      to_x: "elm.text";
256                   }
257                   align: 0.0 0.5;
258                }
259             }
260             part {
261                name: "bar_right_padding";
262                type: SWALLOW;
263                scale: 1;
264                description {
265                   state: "default" 0.0;
266                   visible: 0;
267                   min: 10 0;
268                   fixed: 1 1;
269                   rel1 {
270                      relative: 0.0  0.5;
271                      to_x: "elm.units";
272                   }
273                   rel2 {
274                      relative: 0.0  0.5;
275                      to_x: "elm.units";
276                   }
277                   align: 1.0 0.5;
278                }
279             }
280             part { name: "elm.swallow.icon";
281                type: SWALLOW;
282                scale: 1;
283                description { state: "default" 0.0;
284                   visible: 0;
285                   align: 0.0 0.5;
286                   rel1 {
287                      to_y: "elm.swallow.bar";
288                   }
289                   rel2 {
290                      relative: 0.0 1.0;
291                      to_y: "elm.swallow.bar";
292                   }
293                }
294                description { state: "visible" 0.0;
295                   inherit: "default" 0.0;
296                   visible: 1;
297                   aspect: 1.0 1.0;
298                   aspect_preference: VERTICAL;
299                }
300             }
301             part { name: "elm.text";
302                type: TEXT;
303                mouse_events: 0;
304                scale: 1;
305                description { state: "default" 0.0;
306                   visible: 0;
307                   fixed: 1 1;
308                   align: 0.0 0.5;
309                   rel1.to_x: "elm.swallow.icon";
310                   rel1.relative: 1.0 0.0;
311                   rel1.offset: -1 4;
312                   rel2.to_x: "elm.swallow.icon";
313                   rel2.relative: 1.0 1.0;
314                   rel2.offset: -1 -5;
315                   color: SLIDER_UNITS_TEXT_COLOR_INC;
316                   text {
317                      font: "Tizen:style=Medium";
318                      size: SLIDER_UNITS_TEXT_SIZE_INC;
319                      min: 0 0;
320                      align: 0.0 0.5;
321                      text_class: "tizen";
322                   }
323                }
324                description { state: "visible" 0.0;
325                   inherit: "default" 0.0;
326                   visible: 1;
327                   text.min: 1 1;
328                   rel1.offset: 0 4;
329                   rel2.offset: 0 -5;
330                }
331             }
332             part { name: "elm.swallow.end";
333                type: SWALLOW;
334                scale: 1;
335                description { state: "default" 0.0;
336                   visible: 0;
337                   align: 1.0 0.5;
338                   rel1 {
339                      relative: 1.0 0.0;
340                      to_y: "elm.swallow.bar";
341                   }
342                   rel2 {
343                      relative: 1.0 1.0;
344                      to_y: "elm.swallow.bar";
345                   }
346                }
347                description { state: "visible" 0.0;
348                   inherit: "default" 0.0;
349                   visible: 1;
350                   aspect: 1.0 1.0;
351                   aspect_preference: VERTICAL;
352                }
353             }
354             part { name: "elm.units";
355                type: TEXT;
356                mouse_events: 0;
357                scale: 1;
358                description { state: "default" 0.0;
359                   visible: 0;
360                   fixed: 1 1;
361                   align: 1.0 0.5;
362                   rel1.relative: 0.0 0.0;
363                   rel1.offset: 0 8;
364                   rel1.to_x: "elm.swallow.end";
365                   rel2.relative: 0.0 1.0;
366                   rel2.offset: 0 -9;
367                   rel2.to_x: "elm.swallow.end";
368                   color: SLIDER_UNITS_TEXT_COLOR_INC;
369                   text {
370                      font: "Tizen:style=Bold";
371                      size: SLIDER_UNITS_TEXT_SIZE_INC;
372                      min: 0 0;
373                      align: 0.0 0.5;
374                      text_class: "tizen";
375                   }
376                }
377                description { state: "visible" 0.0;
378                   inherit: "default" 0.0;
379                   fixed: 1 1;
380                   visible: 1;
381                   text.min: 1 1;
382                   rel1.offset: -5 0;
383                   rel2.offset: -5 -1;
384                }
385             }
386             part { name: "elm.dragable.slider";
387                type: GROUP;
388                source: "elm/slider/horizontal/indicator/tap_to_drag";
389                mouse_events: 1;
390                scale: 1;
391                dragable {
392                   x: 1 1 0;
393                   y: 0 0 0;
394                   confine: "bg";
395                }
396                description { state: "default" 0.0;
397                   min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
398                   fixed: 1 1;
399                   rel1 {
400                      relative: 0.5 0.0;
401                      to_x: "bg";
402                   }
403                   rel2 {
404                      relative: 0.5 1.0;
405                      to_x: "bg";
406                   }
407                   color: 8 8 8 8;
408                }
409             }
410             part { name: "disabler";
411                type: RECT;
412                mouse_events: 1;
413                repeat_events: 0;
414                scale: 1;
415                description { state: "default" 0.0;
416                   visible: 0;
417                   min: 1 1;
418                   color: 8 8 8 8;
419                }
420                description { state: "disabled" 0.0;
421                   inherit: "default" 0.0;
422                   visible: 1;
423                }
424             }
425             part { name: "clipper";
426                type: RECT;
427                description { state: "default" 0.0;
428                   color: 255 255 255 255;
429                }
430                description { state: "disabled" 0.0;
431                   color: 255 255 255 102;
432                }
433             }
434          }
435                   programs {
436             program { name: "text_show";
437             signal: "elm,state,text,visible";
438             source: "elm";
439             action:  STATE_SET "visible" 0.0;
440             target: "elm.text";
441          }
442          program { name: "text_hide";
443             signal: "elm,state,text,hidden";
444             source: "elm";
445             action:  STATE_SET "default" 0.0;
446             target: "elm.text";
447          }
448          program { name: "icon_show";
449             signal: "elm,state,icon,visible";
450             source: "elm";
451             action:  STATE_SET "visible" 0.0;
452             target: "elm.swallow.icon";
453          }
454          program { name: "icon_hide";
455             signal: "elm,state,icon,hidden";
456             source: "elm";
457             action:  STATE_SET "default" 0.0;
458             target: "elm.swallow.icon";
459          }
460          program { name: "end_show";
461             signal: "elm,state,end,visible";
462             source: "elm";
463             action:  STATE_SET "visible" 0.0;
464             target: "elm.swallow.end";
465          }
466          program { name: "end_hide";
467             signal: "elm,state,end,hidden";
468             source: "elm";
469             action:  STATE_SET "default" 0.0;
470             target: "elm.swallow.end";
471          }
472          program { name: "units_show";
473             signal: "elm,state,units,visible";
474             source: "elm";
475             action:  STATE_SET "visible" 0.0;
476             target: "elm.units";
477          }
478          program { name: "units_hide";
479             signal: "elm,state,units,hidden";
480             source: "elm";
481             action:  STATE_SET "default" 0.0;
482             target: "elm.units";
483          }
484          program { name: "invert_on";
485             signal: "elm,state,inverted,on";
486             source: "elm";
487             script {
488                set_invert_on();
489             }
490          }
491          program { name: "invert_off";
492             signal: "elm,state,inverted,off";
493             source: "elm";
494             script {
495                set_invert_off();
496             }
497          }
498          program { name: "val_show";
499             signal: "mouse,down,*";
500             source: "elm.dragable.slider";
501             script {
502                thumb_down();
503             }
504          }
505          program { name: "val_hide";
506             signal: "mouse,up,*";
507             source: "elm.dragable.slider";
508             script {
509                thumb_up();
510             }
511          }
512          program { name: "slider_disable";
513             signal: "elm,state,disabled";
514             source: "elm";
515             action:  STATE_SET "disabled" 0.0;
516             target: "disabler";
517             target: "clipper";
518          }
519          program { name: "slider_enable";
520             signal: "elm,state,enabled";
521             source: "elm";
522             action:  STATE_SET "default" 0.0;
523             target: "disabler";
524             target: "clipper";
525          }
526                   program { name: "center_point_enable";
527             signal: "slider,center,point,show";
528             action:  STATE_SET "visible" 0.0;
529             target: "center_point";
530          }
531          program { name: "center_point_disable";
532             signal: "slider,center,point,hide";
533             action:  STATE_SET "default" 0.0;
534             target: "center_point";
535          }
536       }
537    }
538
539    group { name: "elm/slider/horizontal/indicator/default";
540            alias: "elm/slider/horizontal/indicator/disabled";
541            alias: "elm/slider/horizontal/indicator/tap_to_drag";
542            alias: "elm/slider/horizontal/indicator/textstyle";
543            alias: "elm/slider/horizontal/indicator/numberstyle";
544       images {
545          image: "00_slider_handle.png" COMP;
546          image: "00_slider_handle_dim.png" COMP;
547          image: "00_slider_handle_press.png" COMP;
548       }
549       styles{
550          style { name: "indicator_default";
551             base: "font=Tizen:style=Medium font_size="SLIDER_INDICATOR_TEXT_SIZE_INC" align=center color="SLIDER_INDICATOR_TEXT_COLOR_INC" style=shadow,bottom shadow_color="SLIDER_INDICATOR_TEXT_SHADOW_TEXTBLOCK_NORMAL_COLOR_INC" ellipsis=1.0 wrap=none text_class=tizen";
552             tag: "br" "\n";
553             tag: "ps" "ps";
554             tag: "tab" "\t";
555          }
556          style { name: "indicator_pressed";
557             base: "font=Tizen:style=Medium font_size="SLIDER_INDICATOR_TEXT_SIZE_INC" align=center color="SLIDER_INDICATOR_TEXT_PRESSED_COLOR_INC" style=shadow,top shadow_color="SLIDER_INDICATOR_TEXT_SHADOW_TEXTBLOCK_PRESSED_COLOR_INC" ellipsis=1.0 wrap=none text_class=tizen";
558             tag: "br" "\n";
559             tag: "ps" "ps";
560             tag: "tab" "\t";
561          }
562          style { name: "indicator_dim";
563             base: "font=Tizen:style=Medium font_size="SLIDER_INDICATOR_TEXT_SIZE_INC" align=center color="SLIDER_INDICATOR_TEXT_DIM_COLOR_INC" style=shadow,bottom shadow_color="SLIDER_INDICATOR_TEXT_SHADOW_TEXTBLOCK_DIM_COLOR_INC" ellipsis=1.0 wrap=none text_class=tizen";
564             tag: "br" "\n";
565             tag: "ps" "ps";
566             tag: "tab" "\t";
567          }
568       }
569       parts {
570          part { name: "access";
571             type: RECT;
572             description { state: "default" 0.0;
573                fixed: 1 1;
574                color: 8 8 8 8;
575             }
576          }
577          part { name: "button_events";
578             type: RECT;
579             mouse_events: 1;
580             scale: 1;
581             description { state: "default" 0.0;
582                fixed: 1 1;
583                min: 2*SLIDER_INDICATOR_WIDTH_INC 1.5*SLIDER_INDICATOR_HEIGHT_INC;
584                aspect: 1.0 1.0;
585                aspect_preference: VERTICAL;
586                color: 8 8 8 8;
587             }
588             description { state: "disabled" 0.0;
589                inherit: "default" 0.0;
590                visible: 0;
591             }
592          }
593          part { name: "image_left_padding";
594             type: SPACER;
595             scale: 1;
596             description { state: "default" 0.0;
597                fixed: 1 1;
598                min: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
599                max: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
600                rel1 {
601                   to_x: "elm.indicator";
602                   relative: -1.0 0.0;
603                }
604                rel2 {
605                   to_x: "elm.indicator";
606                   relative: 0.0 1.0;
607                }
608                align: 1.0 0.5;
609             }
610          }
611          part { name: "image_right_padding";
612             type: SPACER;
613             scale: 1;
614             description { state: "default" 0.0;
615                fixed: 1 1;
616                min: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
617                max: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
618                rel1 {
619                   to_x: "elm.indicator";
620                   relative: 1.0 0.0;
621                }
622                rel2 {
623                   to_x: "elm.indicator";
624                   relative: 2.0 1.0;
625                }
626                align: 0.0 0.5;
627             }
628          }
629          part { name: "button0";
630             mouse_events: 0;
631             scale: 1;
632             description { state: "default" 0.0;
633                fixed: 1 1;
634                min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
635                max: SLIDER_INDICATOR_MAX_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
636                rel1.to: "image_left_padding";
637                rel2.to: "image_right_padding";
638                image {
639                   normal: "00_slider_handle.png";
640                   border: SLIDER_INDICATOR_IMAGE_BORDER_INC;
641                   border_scale: 1;
642                }
643             }
644             description { state: "pressed" 0.0;
645                inherit: "default" 0.0;
646                image {
647                   normal: "00_slider_handle_press.png";
648                }
649             }
650             description { state: "disabled" 0.0;
651                inherit: "default" 0.0;
652                image {
653                   normal: "00_slider_handle_dim.png";
654                }
655             }
656          }
657          part { name: "elm.indicator";
658             type: TEXTBLOCK;
659             mouse_events: 0;
660             scale: 1;
661             description { state: "default" 0.0;
662                text {
663                   style: "indicator_default";
664                   min: 1 1;
665                }
666             }
667             description { state: "hide" 0.0;
668                inherit: "default" 0.0;
669                visible: 0;
670              }
671             description { state: "pressed" 0.0;
672                inherit: "default" 0.0;
673                text {
674                   style: "indicator_pressed";
675                   min: 1 1;
676                }
677             }
678             description { state: "dim" 0.0;
679                inherit: "default" 0.0;
680                text {
681                   style: "indicator_dim";
682                   min: 1 1;
683                }
684             }
685          }
686       }
687       programs {
688          program { name: "set_val_show";
689             signal: "elm,state,val,show";
690             source: "elm";
691             action:  STATE_SET "default" 0.0;
692             target: "elm.indicator";
693          }
694          program { name: "set_val_hide";
695             signal: "elm,state,val,hide";
696             source: "elm";
697             action:  STATE_SET "hide" 0.0;
698             target: "elm.indicator";
699          }
700          program { name: "slider_disable";
701             signal: "elm,state,disabled";
702             source: "elm";
703             action:  STATE_SET "disabled" 0.0;
704             target: "button0";
705             target: "button_events";
706          }
707          program { name: "slider_enable";
708             signal: "elm,state,enabled";
709             source: "elm";
710             action:  STATE_SET "default" 0.0;
711             target: "button0";
712             target: "button_events";
713          }
714          program { name: "mouse_down";
715             signal: "mouse,down,*";
716             source: "button_events";
717             action:  STATE_SET "pressed" 0.0;
718             target: "button0";
719             after: "text_pressed";
720          }
721          program { name: "mouse_up";
722             signal: "mouse,up,*";
723             source: "button_events";
724             action:  STATE_SET "default" 0.0;
725             target: "button0";
726             after: "text_unpressed";
727          }
728          program { name: "text_pressed";
729             script {
730                new st[31];
731                new Float:vl;
732                get_state(PART:"elm.indicator", st, 30, vl);
733                if (!strcmp(st, "default"))
734                  set_state(PART:"elm.indicator", "pressed", 0.0);
735             }
736          }
737          program { name: "text_unpressed";
738             script {
739                new st[31];
740                new Float:vl;
741                get_state(PART:"elm.indicator", st, 30, vl);
742                if (!strcmp(st, "pressed"))
743                  set_state(PART:"elm.indicator", "default", 0.0);
744             }
745          }
746       }
747    }
748
749 }
750
751
752
753
754
755