up spin button is now shown
[framework/web/webkit-efl.git] / Source / WebKit / efl / DefaultTheme / widget / spinner / spinner.edc
1 /*
2  * Copyright (C) 2012, Intel Corporation.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU Lesser General Public License,
6  * version 2.1, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License along with
14  * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St
15  * - Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  */
18
19 group {
20     name: "webkit/widget/spinner";
21
22     images {
23        image: "widget/spinner/sp_bg.png" COMP;
24        image: "widget/spinner/sp_up_default.png" COMP;
25        image: "widget/spinner/sp_down_default.png" COMP;
26        image: "widget/spinner/sp_up_pressed.png" COMP;
27        image: "widget/spinner/sp_down_pressed.png" COMP;
28        image: "widget/spinner/sp_up_hover.png" COMP;
29        image: "widget/spinner/sp_down_hover.png" COMP;
30     }
31
32     script {
33         public isSpinup;
34         public isEnabled;
35         public isPressed;
36
37         public show() {
38             if (get_int(isEnabled) == 1) {
39                 set_state(PART:"up_bt", "default", 0.0);
40                 set_state(PART:"down_bt", "default", 0.0);
41                 if (get_int(isSpinup)) {
42                     if (get_int(isPressed))
43                         set_state(PART:"up_bt", "pressed", 0.0);
44                 }
45                 else {
46                     if (get_int(isPressed))
47                         set_state(PART:"down_bt", "pressed", 0.0);
48                 }
49             }
50             else {
51                 set_state(PART:"up_bt", "disabled", 0.0);
52                 set_state(PART:"down_bt", "disabled", 0.0);
53             }
54         }
55     }
56
57     parts {
58         part {
59             name: "bg";
60             type: IMAGE;
61             description {
62                 state: "default" 0.0;
63                 rel1 {
64                     relative: 0.0 0.0;
65                     offset: 0 6;
66                 }
67                 rel2 {
68                     relative: 1.0 1.0;
69                     offset: -2 -6;
70                 }
71                 image {
72                     normal: "widget/spinner/sp_bg.png";
73                     border: 1 0 0 0;
74                 }
75             }
76         }
77
78         part {
79             name: "up_bt";
80             description {
81                 state: "default" 0.0;
82                 min: 9 7;
83                 max: 9 7;
84                 fixed: 1 1;
85                 align: 0.5 0;
86                 rel1 {
87                     relative: 0.0 0.0;
88                 }
89                 rel2 {
90                     relative: 1.0 0.0;
91                     offset: -1 0;
92                 }
93                 image.normal: "widget/spinner/sp_up_default.png";
94             }
95             description {
96                 state: "pressed" 0.0;
97                 inherit: "default" 0.0;
98                 image.normal: "widget/spinner/sp_up_pressed.png";
99             }
100             description {
101                 state: "disabled" 0.0;
102                 inherit: "default" 0.0;
103                 color: 255 255 255 150;
104             }
105         }
106
107         part {
108             name: "down_bt";
109             description {
110                 state: "default" 0.0;
111                 min: 9 7;
112                 max: 9 7;
113                 fixed: 1 1;
114                 align: 0.5 1;
115                 rel1 {
116                     relative: 0.0 1.0;
117                     offset: 0 0;
118                 }
119                 rel2 {
120                     relative: 1.0 1.0;
121                     offset: -1 0;
122                 }
123                 image.normal: "widget/spinner/sp_down_default.png";
124             }
125             description {
126                 state: "pressed" 0.0;
127                 inherit: "default" 0.0;
128                 image.normal: "widget/spinner/sp_down_pressed.png";
129             }
130             description {
131                 state: "disabled" 0.0;
132                 inherit: "default" 0.0;
133                 color: 255 255 255 150;
134             }
135         }
136
137         part {
138             name: "text_confinement";
139             type: RECT;
140             description {
141                 state: "default" 0.0;
142                 rel1 {
143                     relative: 0.0 0.0;
144                     offset: 0 0;
145                 }
146                 rel2 {
147                     relative: 1.0 1.0;
148                     offset: -18 0;
149                 }
150             }
151         }
152     }
153
154     programs {
155         program {
156             name: "spinup";
157             signal: "spinup";
158             script {
159                 set_int(isSpinup, 1);
160                 show();
161             }
162         }
163
164         program {
165             name: "pressed";
166             signal: "pressed";
167             script {
168                 set_int(isPressed, 1);
169                 show();
170             }
171         }
172
173         program {
174             name: "enabled";
175             signal: "enabled";
176             script {
177                 set_int(isEnabled, 1);
178                 show();
179             }
180         }
181         program {
182             name: "reset";
183             signal: "reset";
184             script {
185                 set_int(isSpinup, 0);
186                 set_int(isEnabled, 0);
187                 set_int(isPressed, 0);
188                 show();
189             }
190         }
191     }
192 }