2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
17 #include "quickpanel_def.h"
20 #include "quickpanel_theme_element.edc"
25 base: "font=Tizen:style=Regular text_class=tizen align=center font_size=28 color=#FFFFFFFF ellipsis=0.0 wrap=mixed";
29 #define NOTI_BUTTON_STATE_ENABLED 0
30 #define NOTI_BUTTON_STATE_DISABLED 1
32 group { name: "elm/button/base/quickpanel_standard";
34 image: "quick_standard_btn_press.png" COMP;
35 image: "quick_standard_btn_nor.png" COMP;
39 public button_state = NOTI_BUTTON_STATE_ENABLED;
42 part { name: "button_image";
57 normal: "quick_standard_btn_nor.png";
61 description { state: "clicked" 0.0;
62 inherit: "default" 0.0;
64 normal: "quick_standard_btn_press.png";
68 description { state: "disabled" 0.0;
69 inherit: "default" 0.0;
71 description { state: "focused" 0.0;
72 inherit: "default" 0.0;
75 part { name: "elm.text.rect";
79 description { state: "default" 0.0;
93 part { name: "elm.text";
98 description { state: "default" 0.0;
101 color: 149 148 148 255;
109 style: "button_text";
116 description { state: "visible" 0.0;
117 inherit: "default" 0.0;
121 description { state: "clicked" 0.0;
122 inherit: "default" 0.0;
125 color: 255 255 255 255;
127 description { state: "disabled" 0.0;
128 inherit: "default" 0.0;
131 description { state: "disabled_visible" 0.0;
132 inherit: "default" 0.0;
136 description { state: "focused" 0.0;
137 inherit: "default" 0.0;
140 color: 255 255 255 255;
143 part { name: "over1";
145 description { state: "default" 0.0;
146 rel2.relative: 1.0 0.5;
149 part { name: "over2";
152 ignore_flags: ON_HOLD;
153 description { state: "default" 0.0;
154 rel1.to: "button_image";
155 rel2.to: "button_image";
158 part { name: "over3";
161 description { state: "default" 0.0;
162 rel1.to: "button_image";
163 rel2.to: "button_image";
167 part { name: "disabler";
169 description { state: "default" 0.0;
170 rel1.to: "button_image";
171 rel2.to: "button_image";
175 description { state: "disabled" 0.0;
176 inherit: "default" 0.0;
182 program { name: "button_click";
183 signal: "mouse,down,1";
185 action: SIGNAL_EMIT "elm,action,press" "";
186 after: "button_click_anim";
188 program { name: "button_click_anim";
189 action: STATE_SET "clicked" 0.0;
190 target: "button_image";
193 program { name: "button_unpress";
194 action: SIGNAL_EMIT "elm,action,unpress" "";
196 program { name: "button_mouseout_clicked";
197 signal: "mouse,up,1";
202 get_state(PART:"elm.text", st, 30, vl);
203 if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
205 emit("elm,action,default,text,set", "");
206 set_state(PART:"elm.text", "visible", 0.0);
208 if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
210 set_state(PART:"button_image", "default", 0.0);
213 after: button_unpress;
215 program { name: "button_unclick3";
216 signal: "mouse,clicked,1";
218 action: SIGNAL_EMIT "elm,action,click" "";
220 program { name: "text_show";
221 signal: "elm,state,text,visible";
224 if(get_int(button_state) != NOTI_BUTTON_STATE_DISABLED)
225 set_state(PART:"elm.text", "visible", 0.0);
227 set_state(PART:"elm.text", "disabled_visible", 0.0);
230 program { name: "text_hide";
231 signal: "elm,state,text,hidden";
233 action: STATE_SET "default" 0.0;
237 program { name: "disable";
238 signal: "elm,state,disabled";
240 action: STATE_SET "disabled" 0.0;
241 target: "button_image";
243 after: "disable_text";
245 program { name: "disable_text";
249 get_state(PART:"elm.text", st, 30, vl);
250 if (!strcmp(st, "visible"))
251 set_state(PART:"elm.text", "disabled_visible", 0.0);
253 set_state(PART:"elm.text", "disabled", 0.0);
254 set_int(button_state, NOTI_BUTTON_STATE_DISABLED);
257 program { name: "enable";
258 signal: "elm,state,enabled";
260 action: STATE_SET "default" 0.0;
261 target: "button_image";
263 after: "enable_text";
265 program { name: "enable_text";
269 get_state(PART:"elm.text", st, 30, vl);
270 if (!strcmp(st, "disabled_visible"))
271 set_state(PART:"elm.text", "visible", 0.0);
273 set_state(PART:"elm.text", "default", 0.0);
274 set_int(button_state, NOTI_BUTTON_STATE_ENABLED);
277 program { name: "focused";
278 //signal: "elm,action,focus";
280 action: STATE_SET "focused" 0.0;
281 target: "button_image";
284 program { name: "unfocused";
285 //signal: "elm,action,unfocus";
287 action: STATE_SET "default" 0.0;
288 target: "button_image";
289 action: STATE_SET "visible" 0.0;
292 program { name: "reset_button_state";
293 signal: "elm,action,button,reset";
295 action: STATE_SET "default" 0.0;
296 target: "button_image";