fix manifest - remove unnecessary labels
[apps/core/preloaded/quickpanel.git] / data / quickpanel_theme.edc
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *  http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "quickpanel_def.h"
18
19 collections {
20         #include "quickpanel_theme_element.edc"
21
22         styles {
23                 style {
24                         name: "button_text";
25                         base: "font=Tizen:style=Regular text_class=tizen align=center font_size=28 color=#FFFFFFFF ellipsis=0.0 wrap=mixed";
26                 }
27         }
28
29 #define NOTI_BUTTON_STATE_ENABLED 0
30 #define NOTI_BUTTON_STATE_DISABLED 1
31
32         group { name: "elm/button/base/quickpanel_standard";
33                 images {
34                         image: "quick_standard_btn_press.png" COMP;
35                         image: "quick_standard_btn_nor.png" COMP;
36                 }
37
38                 script {
39                         public button_state = NOTI_BUTTON_STATE_ENABLED;
40                 }
41                 parts {
42                         part { name: "button_image";
43                                 type: IMAGE;
44                                 mouse_events: 1;
45                                 scale: 1;
46                                 description { 
47                                         state: "default" 0.0;
48                                         min: 145 59;
49                                         fixed: 1 1;
50                                         rel1 {
51                                                 relative: 0.0 0.0;
52                                         }
53                                         rel2 {
54                                                 relative: 1.0 1.0;
55                                         }
56                                         image {
57                                                 normal: "quick_standard_btn_nor.png";
58                                                 border: 10 10 0 0;
59                                         }
60                                 }
61                                 description { state: "clicked" 0.0;
62                                         inherit: "default" 0.0;
63                                         image {
64                                                 normal: "quick_standard_btn_press.png";
65                                                 border: 10 10 0 0;
66                                         }
67                                 }
68                                 description { state: "disabled" 0.0;
69                                         inherit: "default" 0.0;
70                                 }
71                                 description { state: "focused" 0.0;
72                                         inherit: "default" 0.0;
73                                 }
74                         }
75                 part {   name: "elm.text.rect";
76                         type: RECT;
77                         mouse_events: 0;
78                         scale: 1;
79                         description { state: "default" 0.0;
80                                 visible: 0;
81                                 fixed: 1 1;
82                                 align: 0.5 0.5;
83                                         rel1 {
84                                                 relative: 0.05 0.05;
85                                                 to: "button_image";
86                                         }
87                                         rel2 {
88                                                 relative: 0.95 0.95;
89                                                 to: "button_image";
90                                         }
91                         }
92                 }
93                 part {   name: "elm.text";
94                         type: TEXTBLOCK;
95                         mouse_events: 0;
96                         scale: 1;
97                         multiline: 1;
98                         description { state: "default" 0.0;
99                                 visible: 0;
100                                 fixed: 1 1;
101                                 color: 149 148 148 255;
102                                         rel1 {
103                                                 to: "elm.text.rect";
104                                         }
105                                         rel2 {
106                                                 to: "elm.text.rect";
107                                         }
108                                 text {
109                                                 style: "button_text";
110                                                 size: 28;
111                                                 align: 0.5 0.5;
112                                                 fit: 1 1;
113                                                 size_range: 22 28;
114                                 }
115                         }
116                         description { state: "visible" 0.0;
117                                 inherit: "default" 0.0;
118                                 visible: 1;
119                                 min: 1 1;
120                         }
121                         description { state: "clicked" 0.0;
122                                 inherit: "default" 0.0;
123                                 visible: 1;
124                                 min: 1 1;
125                                 color: 255 255 255 255;
126                         }
127                         description { state: "disabled" 0.0;
128                                 inherit: "default" 0.0;
129                                 color: 0 0 0 128;
130                         }
131                         description { state: "disabled_visible" 0.0;
132                                 inherit: "default" 0.0;
133                                 visible: 1;
134                                 min: 1 1;
135                         }
136                         description { state: "focused" 0.0;
137                                 inherit: "default" 0.0;
138                                 visible: 1;
139                                 min: 1 1;
140                                 color: 255 255 255 255;
141                         }
142                 }
143                 part { name: "over1";
144                         mouse_events: 0;
145                         description { state: "default" 0.0;
146                                 rel2.relative: 1.0 0.5;
147                         }
148                 }
149                 part { name: "over2";
150                         mouse_events: 1;
151                         repeat_events: 1;
152                         ignore_flags: ON_HOLD;
153                         description { state: "default" 0.0;
154                                 rel1.to: "button_image";
155                                 rel2.to: "button_image";
156                         }
157                 }
158                 part { name: "over3";
159                         mouse_events: 1;
160                         repeat_events: 1;
161                         description { state: "default" 0.0;
162                                 rel1.to: "button_image";
163                                 rel2.to: "button_image";
164                                 color: 0 0 0 0;
165                         }
166                 }
167                 part { name: "disabler";
168                         type: RECT;
169                         description { state: "default" 0.0;
170                                 rel1.to: "button_image";
171                                 rel2.to: "button_image";
172                                 color: 0 0 0 0;
173                                 visible: 0;
174                         }
175                         description { state: "disabled" 0.0;
176                                 inherit: "default" 0.0;
177                                 visible: 1;
178                         }
179                 }
180         }
181         programs {
182                 program { name: "button_click";
183                         signal: "mouse,down,1";
184                         source: "over2";
185                         action: SIGNAL_EMIT "elm,action,press" "";
186                         after: "button_click_anim";
187                 }
188                 program { name: "button_click_anim";
189                         action: STATE_SET "clicked" 0.0;
190                         target: "button_image";
191                         target: "elm.text";
192                 }
193                 program { name: "button_unpress";
194                         action: SIGNAL_EMIT "elm,action,unpress" "";
195                 }
196                 program { name: "button_mouseout_clicked";
197                         signal: "mouse,up,1";
198                         source: "over3";
199                         script {
200                                 new st[31];
201                                 new Float:vl;
202                                 get_state(PART:"elm.text", st, 30, vl);
203                                 if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
204                                 {
205                                         emit("elm,action,default,text,set", "");
206                                         set_state(PART:"elm.text", "visible", 0.0);
207                                 }
208                                 if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
209                                 {
210                                         set_state(PART:"button_image", "default", 0.0);
211                                 }
212                         }
213                         after: button_unpress;
214                 }
215                 program { name: "button_unclick3";
216                         signal: "mouse,clicked,1";
217                         source: "over2";
218                         action: SIGNAL_EMIT "elm,action,click" "";
219                 }
220                 program { name: "text_show";
221                         signal: "elm,state,text,visible";
222                         source: "elm";
223                         script {
224                                 if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
225                                         set_state(PART:"elm.text", "visible", 0.0);
226                                 else
227                                         set_state(PART:"elm.text", "disabled_visible", 0.0);
228                         }
229                 }
230                 program { name: "text_hide";
231                         signal: "elm,state,text,hidden";
232                         source: "elm";
233                         action: STATE_SET "default" 0.0;
234                         target: "elm.text";
235                 }
236
237                 program { name: "disable";
238                         signal: "elm,state,disabled";
239                         source: "elm";
240                         action: STATE_SET "disabled" 0.0;
241                         target: "button_image";
242                         target: "disabler";
243                         after: "disable_text";
244                 }
245                 program { name: "disable_text";
246                         script {
247                                 new st[31];
248                                 new Float:vl;
249                                 get_state(PART:"elm.text", st, 30, vl);
250                                 if (!strcmp(st, "visible"))
251                                         set_state(PART:"elm.text", "disabled_visible", 0.0);
252                                 else
253                                         set_state(PART:"elm.text", "disabled", 0.0);
254                                 set_int(button_state, NOTI_BUTTON_STATE_DISABLED);
255                         }
256                 }
257                 program { name: "enable";
258                         signal: "elm,state,enabled";
259                         source: "elm";
260                         action: STATE_SET "default" 0.0;
261                         target: "button_image";
262                         target: "disabler";
263                         after: "enable_text";
264                 }
265                 program { name: "enable_text";
266                         script {
267                                 new st[31];
268                                 new Float:vl;
269                                 get_state(PART:"elm.text", st, 30, vl);
270                                 if (!strcmp(st, "disabled_visible"))
271                                         set_state(PART:"elm.text", "visible", 0.0);
272                                 else
273                                         set_state(PART:"elm.text", "default", 0.0);
274                                 set_int(button_state, NOTI_BUTTON_STATE_ENABLED);
275                         }
276                 }
277                 program { name: "focused";
278                         //signal: "elm,action,focus";
279                         //source: "elm";
280                         action: STATE_SET "focused" 0.0;
281                         target: "button_image";
282                         target: "elm.text";
283                 }
284                 program { name: "unfocused";
285                         //signal: "elm,action,unfocus";
286                         //source: "elm";
287                         action: STATE_SET "default" 0.0;
288                         target: "button_image";
289                         action: STATE_SET "visible" 0.0;
290                         target: "elm.text";
291                 }
292                 program { name: "reset_button_state";
293                         signal: "elm,action,button,reset";
294                         source: "elm";
295                         action: STATE_SET "default" 0.0;
296                         target: "button_image";
297                 }
298         }
299 }