3 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 group { name: "elm/slider/horizontal/tap_to_drag";
22 image: "00_progress_bg.png" COMP;
23 image: "00_progress_bar.png" COMP;
27 public set_invert_on() {
28 set_state(PART:"level", "inverted", 0.0);
29 set_state(PART:"level2", "inverted", 0.0);
30 set_int(invert_on, 1);
32 public set_invert_off() {
33 set_state(PART:"level", "default", 0.0);
34 set_state(PART:"level2", "default", 0.0);
35 set_int(invert_on, 0);
38 if(get_int(invert_on) == 0)
39 set_state(PART:"level", "pressed", 0.0);
40 else if(get_int(invert_on) == 1)
41 set_state(PART:"level2", "pressed", 0.0);
44 if(get_int(invert_on) == 0)
45 set_state(PART:"level", "default", 0.0);
46 else if(get_int(invert_on) == 1)
47 set_state(PART:"level2", "inverted", 0.0);
51 part { name: "access";
53 description { state: "default" 0.0;
61 description { state: "default" 0.0;
62 min: SLIDER_BASE_MIN_WIDTH_INC SLIDER_BASE_HEIGHT_INC;
63 max: 99999 SLIDER_BASE_HEIGHT_INC;
70 image.normal: "00_progress_bg.png";
71 image.border: PROGRESS_BG_IMAGE_BORDER_INC;
72 image.border_scale: 1;
76 name: "bar_image_left_padding";
82 min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
83 max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
94 name: "bar_image_right_padding";
100 min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
101 max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
111 part { name: "level";
115 description { state: "default" 0.0;
118 to_x: "bar_image_left_padding";
124 to_x: "elm.dragable.slider";
128 image.normal: "00_progress_bar.png";
129 image.border: PROGRESS_BAR_IMAGE_BORDER_INC;
130 image.border_scale: 1;
132 description { state: "inverted" 0.0;
133 inherit: "default" 0.0;
136 description { state: "pressed" 0.0;
137 inherit: "default" 0.0;
140 part { name: "level2";
144 description { state: "default" 0.0;
149 to_x: "elm.dragable.slider";
153 to_x: "bar_image_right_padding";
157 image.normal: "00_progress_bg.png";
158 image.border: PROGRESS_BG_IMAGE_BORDER_INC;
159 image.border_scale: 1;
161 description { state: "inverted" 0.0;
162 inherit: "default" 0.0;
165 description { state: "pressed" 0.0;
166 inherit: "default" 0.0;
174 description { state: "default" 0.0;
176 rel1.to: "elm.swallow.bar";
177 rel2.to: "elm.swallow.bar";
182 part { name: "elm.swallow.bar";
185 description { state: "default" 0.0;
186 min: SLIDER_SWALLOW_BAR_MIN_WIDTH_INC SLIDER_SWALLOW_BAR_HEIGHT_INC;
187 max: 99999 SLIDER_SWALLOW_BAR_HEIGHT_INC;
190 to_x: "bar_left_padding";
194 to_x: "bar_right_padding";
200 name: "bar_left_padding";
204 state: "default" 0.0;
220 name: "bar_right_padding";
224 state: "default" 0.0;
239 part { name: "elm.swallow.icon";
242 description { state: "default" 0.0;
246 to_y: "elm.swallow.bar";
250 to_y: "elm.swallow.bar";
253 description { state: "visible" 0.0;
254 inherit: "default" 0.0;
257 aspect_preference: VERTICAL;
260 part { name: "elm.text";
264 description { state: "default" 0.0;
268 rel1.to_x: "elm.swallow.icon";
269 rel1.relative: 1.0 0.0;
271 rel2.to_x: "elm.swallow.icon";
272 rel2.relative: 1.0 1.0;
274 color: SLIDER_UNITS_TEXT_COLOR_INC;
276 font: "Tizen:style=Medium";
277 size: SLIDER_UNITS_TEXT_SIZE_INC;
283 description { state: "visible" 0.0;
284 inherit: "default" 0.0;
291 part { name: "elm.swallow.end";
294 description { state: "default" 0.0;
299 to_y: "elm.swallow.bar";
303 to_y: "elm.swallow.bar";
306 description { state: "visible" 0.0;
307 inherit: "default" 0.0;
310 aspect_preference: VERTICAL;
313 part { name: "units";
316 description { state: "default" 0.0;
323 // normal: "sl_units.png";
328 description { state: "visible" 0.0;
329 inherit: "default" 0.0;
333 part { name: "elm.units";
337 description { state: "default" 0.0;
341 rel1.relative: 0.0 0.0;
343 rel1.to_x: "elm.swallow.end";
344 rel2.relative: 0.0 1.0;
346 rel2.to_x: "elm.swallow.end";
347 color: SLIDER_UNITS_TEXT_COLOR_INC;
349 font: "Tizen:style=Bold";
350 size: SLIDER_UNITS_TEXT_SIZE_INC;
356 description { state: "visible" 0.0;
357 inherit: "default" 0.0;
365 part { name: "elm.dragable.slider";
367 source: "elm/slider/horizontal/indicator/tap_to_drag";
375 description { state: "default" 0.0;
376 min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
389 part { name: "disabler";
394 description { state: "default" 0.0;
399 description { state: "disabled" 0.0;
400 inherit: "default" 0.0;
404 part { name: "clipper";
406 description { state: "default" 0.0;
407 color: 255 255 255 255;
409 description { state: "disabled" 0.0;
410 color: 255 255 255 102;
415 program { name: "text_show";
416 signal: "elm,state,text,visible";
418 action: STATE_SET "visible" 0.0;
421 program { name: "text_hide";
422 signal: "elm,state,text,hidden";
424 action: STATE_SET "default" 0.0;
427 program { name: "icon_show";
428 signal: "elm,state,icon,visible";
430 action: STATE_SET "visible" 0.0;
431 target: "elm.swallow.icon";
433 program { name: "icon_hide";
434 signal: "elm,state,icon,hidden";
436 action: STATE_SET "default" 0.0;
437 target: "elm.swallow.icon";
439 program { name: "end_show";
440 signal: "elm,state,end,visible";
442 action: STATE_SET "visible" 0.0;
443 target: "elm.swallow.end";
445 program { name: "end_hide";
446 signal: "elm,state,end,hidden";
448 action: STATE_SET "default" 0.0;
449 target: "elm.swallow.end";
451 program { name: "units_show";
452 signal: "elm,state,units,visible";
454 action: STATE_SET "visible" 0.0;
458 program { name: "units_hide";
459 signal: "elm,state,units,hidden";
461 action: STATE_SET "default" 0.0;
465 program { name: "invert_on";
466 signal: "elm,state,inverted,on";
472 program { name: "invert_off";
473 signal: "elm,state,inverted,off";
479 program { name: "val_show";
480 signal: "mouse,down,*";
481 source: "elm.dragable.slider";
486 program { name: "val_hide";
487 signal: "mouse,up,*";
488 source: "elm.dragable.slider";
493 program { name: "slider_disable";
494 signal: "elm,state,disabled";
496 action: STATE_SET "disabled" 0.0;
500 program { name: "slider_enable";
501 signal: "elm,state,enabled";
503 action: STATE_SET "default" 0.0;
510 group { name: "elm/slider/horizontal/indicator/default";
511 alias: "elm/slider/horizontal/indicator/disabled";
512 alias: "elm/slider/horizontal/indicator/tap_to_drag";
514 image: "00_slider_handle.png" COMP;
515 image: "00_slider_handle_dim.png" COMP;
516 image: "00_slider_handle_press.png" COMP;
519 part { name: "access";
521 description { state: "default" 0.0;
526 part { name: "button_events";
530 description { state: "default" 0.0;
532 min: 2*SLIDER_INDICATOR_WIDTH_INC 1.5*SLIDER_INDICATOR_HEIGHT_INC;
534 aspect_preference: VERTICAL;
537 description { state: "disabled" 0.0;
538 inherit: "default" 0.0;
542 part { name: "image_left_padding";
546 description { state: "default" 0.0;
549 min: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
550 max: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
552 to_x: "elm.indicator";
556 to_x: "elm.indicator";
562 part { name: "image_right_padding";
566 description { state: "default" 0.0;
569 min: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
570 max: SLIDER_INDICATOR_IMAGE_PADDING_SIZE_INC;
572 to_x: "elm.indicator";
576 to_x: "elm.indicator";
582 part { name: "button0";
585 description { state: "default" 0.0;
587 min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
588 max: SLIDER_INDICATOR_MAX_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
589 rel1.to: "image_left_padding";
590 rel2.to: "image_right_padding";
592 normal: "00_slider_handle.png";
593 border: SLIDER_INDICATOR_IMAGE_BORDER_INC;
597 description { state: "pressed" 0.0;
598 inherit: "default" 0.0;
600 normal: "00_slider_handle_press.png";
603 description { state: "disabled" 0.0;
604 inherit: "default" 0.0;
606 normal: "00_slider_handle_dim.png";
610 part { name: "elm.indicator";
614 description { state: "default" 0.0;
616 color: SLIDER_INDICATOR_TEXT_COLOR_INC;
618 font: "Tizen:style=Medium";
619 size: SLIDER_INDICATOR_TEXT_SIZE_INC;
625 description { state: "hide" 0.0;
626 inherit: "default" 0.0;
629 description { state: "pressed" 0.0;
630 inherit: "default" 0.0;
631 color: SLIDER_INDICATOR_TEXT_PRESSED_COLOR_INC;
636 program { name: "set_val_show";
637 signal: "elm,state,val,show";
639 action: STATE_SET "default" 0.0;
640 target: "elm.indicator";
642 program { name: "set_val_hide";
643 signal: "elm,state,val,hide";
645 action: STATE_SET "hide" 0.0;
646 target: "elm.indicator";
648 program { name: "slider_disable";
649 signal: "elm,state,disabled";
651 action: STATE_SET "disabled" 0.0;
653 target: "button_events";
655 program { name: "slider_enable";
656 signal: "elm,state,enabled";
658 action: STATE_SET "default" 0.0;
660 target: "button_events";
662 program { name: "mouse_down";
663 signal: "mouse,down,*";
664 source: "button_events";
665 action: STATE_SET "pressed" 0.0;
667 after: "text_pressed";
669 program { name: "mouse_up";
670 signal: "mouse,up,*";
671 source: "button_events";
672 action: STATE_SET "default" 0.0;
674 after: "text_unpressed";
676 program { name: "text_pressed";
680 get_state(PART:"elm.indicator", st, 30, vl);
681 if (!strcmp(st, "default"))
682 set_state(PART:"elm.indicator", "pressed", 0.0);
685 program { name: "text_unpressed";
689 get_state(PART:"elm.indicator", st, 30, vl);
690 if (!strcmp(st, "pressed"))
691 set_state(PART:"elm.indicator", "default", 0.0);
697 group { name: "elm/slider/horizontal/default";
698 alias: "elm/slider/horizontal/disabled";
700 image: "00_progress_bg.png" COMP;
701 image: "00_progress_bar.png" COMP;
704 public invert_on = 0;
705 public set_invert_on() {
706 set_state(PART:"level", "inverted", 0.0);
707 set_state(PART:"level2", "inverted", 0.0);
708 set_int(invert_on, 1);
710 public set_invert_off() {
711 set_state(PART:"level", "default", 0.0);
712 set_state(PART:"level2", "default", 0.0);
713 set_int(invert_on, 0);
715 public thumb_down() {
716 if(get_int(invert_on) == 0)
717 set_state(PART:"level", "pressed", 0.0);
718 else if(get_int(invert_on) == 1)
719 set_state(PART:"level2", "pressed", 0.0);
722 if(get_int(invert_on) == 0)
723 set_state(PART:"level", "default", 0.0);
724 else if(get_int(invert_on) == 1)
725 set_state(PART:"level2", "inverted", 0.0);
729 part { name: "access";
731 description { state: "default" 0.0;
739 description { state: "default" 0.0;
740 min: SLIDER_BASE_MIN_WIDTH_INC SLIDER_BASE_HEIGHT_INC;
741 max: 99999 SLIDER_BASE_HEIGHT_INC;
744 image.normal: "00_progress_bg.png";
745 image.border: PROGRESS_BG_IMAGE_BORDER_INC;
746 image.border_scale: 1;
750 name: "bar_image_left_padding";
754 state: "default" 0.0;
756 min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
757 max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
768 name: "bar_image_right_padding";
772 state: "default" 0.0;
774 min: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
775 max: PROGRESS_BAR_IMAGE_PADDING_SIZE_INC;
785 part { name: "level";
789 description { state: "default" 0.0;
792 to_x: "bar_image_left_padding";
798 to_x: "elm.dragable.slider";
801 image.normal: "00_progress_bar.png";
802 image.border: PROGRESS_BAR_IMAGE_BORDER_INC;
803 image.border_scale: 1;
805 description { state: "inverted" 0.0;
806 inherit: "default" 0.0;
809 description { state: "pressed" 0.0;
810 inherit: "default" 0.0;
813 part { name: "level2";
817 description { state: "default" 0.0;
822 to_x: "elm.dragable.slider";
827 to_x: "bar_image_left_padding";
830 image.normal: "00_progress_bar.png";
831 image.border: PROGRESS_BAR_IMAGE_BORDER_INC;
832 image.border_scale: 1;
834 description { state: "inverted" 0.0;
835 inherit: "default" 0.0;
838 description { state: "pressed" 0.0;
839 inherit: "default" 0.0;
847 description { state: "default" 0.0;
849 rel1.to: "elm.swallow.bar";
850 rel2.to: "elm.swallow.bar";
853 part { name: "elm.swallow.bar";
857 description { state: "default" 0.0;
858 min: SLIDER_SWALLOW_BAR_MIN_WIDTH_INC SLIDER_SWALLOW_BAR_HEIGHT_INC;
859 max: 99999 SLIDER_SWALLOW_BAR_HEIGHT_INC;
862 to_x: "bar_left_padding";
866 to_x: "bar_right_padding";
872 name: "bar_left_padding";
876 state: "default" 0.0;
892 name: "bar_right_padding";
896 state: "default" 0.0;
911 part { name: "elm.swallow.icon";
914 description { state: "default" 0.0;
918 to_y: "elm.swallow.bar";
922 to_y: "elm.swallow.bar";
925 description { state: "visible" 0.0;
926 inherit: "default" 0.0;
929 aspect_preference: VERTICAL;
932 part { name: "elm.text";
936 description { state: "default" 0.0;
940 rel1.to_x: "elm.swallow.icon";
941 rel1.relative: 1.0 0.0;
942 rel2.to_x: "elm.swallow.icon";
943 color: SLIDER_UNITS_TEXT_COLOR_INC;
945 font: "Tizen:style=Medium";
946 size: SLIDER_UNITS_TEXT_SIZE_INC;
952 description { state: "visible" 0.0;
953 inherit: "default" 0.0;
958 part { name: "elm.swallow.end";
961 description { state: "default" 0.0;
966 to_y: "elm.swallow.bar";
970 to_y: "elm.swallow.bar";
973 description { state: "visible" 0.0;
974 inherit: "default" 0.0;
977 aspect_preference: VERTICAL;
980 part { name: "units";
983 description { state: "default" 0.0;
989 description { state: "visible" 0.0;
990 inherit: "default" 0.0;
994 part { name: "elm.units";
998 description { state: "default" 0.0;
1002 rel1.to_x: "elm.swallow.end";
1003 rel2.relative: 0.0 1.0;
1004 rel2.to_x: "elm.swallow.end";
1005 color: SLIDER_UNITS_TEXT_COLOR_INC;
1007 font: "Tizen:style=Bold";
1008 size: SLIDER_UNITS_TEXT_SIZE_INC;
1011 text_class: "tizen";
1014 description { state: "visible" 0.0;
1015 inherit: "default" 0.0;
1021 part { name: "elm.dragable.slider";
1023 source: "elm/slider/horizontal/indicator/default";
1031 description { state: "default" 0.0;
1032 min: SLIDER_INDICATOR_WIDTH_INC SLIDER_INDICATOR_HEIGHT_INC;
1038 part { name: "disabler";
1043 description { state: "default" 0.0;
1047 description { state: "disabled" 0.0;
1048 inherit: "default" 0.0;
1052 part { name: "clipper";
1054 description { state: "default" 0.0;
1055 color: 255 255 255 255;
1057 description { state: "disabled" 0.0;
1058 color: 255 255 255 102;
1063 program { name: "text_show";
1064 signal: "elm,state,text,visible";
1066 action: STATE_SET "visible" 0.0;
1069 program { name: "text_hide";
1070 signal: "elm,state,text,hidden";
1072 action: STATE_SET "default" 0.0;
1075 program { name: "icon_show";
1076 signal: "elm,state,icon,visible";
1078 action: STATE_SET "visible" 0.0;
1079 target: "elm.swallow.icon";
1081 program { name: "icon_hide";
1082 signal: "elm,state,icon,hidden";
1084 action: STATE_SET "default" 0.0;
1085 target: "elm.swallow.icon";
1087 program { name: "end_show";
1088 signal: "elm,state,end,visible";
1090 action: STATE_SET "visible" 0.0;
1091 target: "elm.swallow.end";
1093 program { name: "end_hide";
1094 signal: "elm,state,end,hidden";
1096 action: STATE_SET "default" 0.0;
1097 target: "elm.swallow.end";
1099 program { name: "units_show";
1100 signal: "elm,state,units,visible";
1102 action: STATE_SET "visible" 0.0;
1103 target: "elm.units";
1106 program { name: "units_hide";
1107 signal: "elm,state,units,hidden";
1109 action: STATE_SET "default" 0.0;
1110 target: "elm.units";
1113 program { name: "invert_on";
1114 signal: "elm,state,inverted,on";
1120 program { name: "invert_off";
1121 signal: "elm,state,inverted,off";
1127 program { name: "val_show";
1128 signal: "mouse,down,*";
1129 source: "elm.dragable.slider";
1134 program { name: "val_hide";
1135 signal: "mouse,up,*";
1136 source: "elm.dragable.slider";
1141 program { name: "slider_disable";
1142 signal: "elm,state,disabled";
1144 action: STATE_SET "disabled" 0.0;
1148 program { name: "slider_enable";
1149 signal: "elm,state,enabled";
1151 action: STATE_SET "default" 0.0;