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.
18 #include "style_tizen_hd_inc.edc"
20 #define BUTTON_STATE_ENABLED 0
21 #define BUTTON_STATE_DISABLED 1
26 //////////////////////////////////////////////////////////////////////////////////////
27 group { name: "elm/button/base/camera/default";
29 image: "00_button_01_normal.png" COMP;
30 image: "00_button_01_normal_press.png" COMP;
31 image: "00_button_01_normal_dim.png" COMP;
32 image: "00_button_01_normal_Focus.png" COMP;
36 part { name: "button_image";
38 description { state: "default" 0.0;
40 normal: "00_button_01_normal.png";
41 border: BUTTON_TEXT_STYLE1_BG_BORDER_INC;
45 description { state: "clicked" 0.0;
46 inherit: "default" 0.0;
47 image.normal: "00_button_01_normal_press.png";
49 description { state: "disabled" 0.0;
50 inherit: "default" 0.0;
51 image.normal: "00_button_01_normal_dim.png";
53 description { state: "focused" 0.0;
54 inherit: "default" 0.0;
55 image.normal: "00_button_01_normal_Focus.png";
58 part { name: "padding_left_top";
62 description { state: "default" 0.0;
64 rel2.relative: 0.0 0.0;
65 min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
74 description { state: "default" 0.0;
75 min: BUTTON_TEXT_STYLE1_BG_MIN_INC;
78 description { state: "visible" 0.0;
79 inherit: "default" 0.0;
80 min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC;
82 description { state: "icononly" 0.0;
83 inherit: "default" 0.0;
84 min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC;
87 part { name: "padding_right_bottom";
91 description { state: "default" 0.0;
93 rel1.relative: 1.0 1.0;
94 min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
99 part { name: "icon_rect";
103 description { state: "default" 0.0;
109 to: "padding_left_top";
113 to_x: "padding_left_top";
114 to_y: "padding_right_bottom";
118 description { state: "visible" 0.0;
120 min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
121 max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
125 to: "padding_left_top";
129 to_x: "padding_left_top";
130 to_y: "padding_right_bottom";
134 description { state: "icononly" 0.0;
135 inherit: "default" 0.0;
138 part { name: "padding_after_icon";
142 description { state: "default" 0.0; //when only icon or no icon is there
148 rel2.to: "icon_rect";
153 description { state: "visible" 0.0;
160 rel2.to: "icon_rect";
162 min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
164 description { state: "icononly" 0.0;
165 inherit: "default" 0.0;
168 part { name: "padding_before_text";
172 description { state: "default" 0.0; //when only icon or no icon is there
177 to_y: "padding_left_top";
182 to_y: "padding_right_bottom";
185 min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
189 part { name: "elm.swallow.content";
193 description { state: "default" 0.0;
198 to: "padding_left_top";
202 to_x: "padding_left_top";
203 to_y: "padding_right_bottom";
207 description { state: "visible" 0.0;
209 min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
210 max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
214 to_x: "padding_before_text";
215 to_y: "padding_left_top";
219 to_x: "padding_before_text";
220 to_y: "padding_right_bottom";
223 description { state: "icononly" 0.0;
224 min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
225 max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
228 part { name: "elm.text";
233 description { state: "default" 0.0;
237 to_x: "padding_after_icon";
238 to_y: "padding_left_top";
242 to: "padding_right_bottom";
244 /*color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;*/
251 description { state: "visible" 0.0;
252 inherit: "default" 0.0;
255 description { state: "clicked" 0.0;
256 inherit: "default" 0.0;
258 color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
260 description { state: "disabled" 0.0;
261 inherit: "default" 0.0;
264 description { state: "disabled_visible" 0.0;
265 inherit: "default" 0.0;
266 color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
269 description { state: "focused" 0.0;
270 inherit: "default" 0.0;
272 color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC;
275 part { name: "over2";
278 ignore_flags: ON_HOLD;
279 description { state: "default" 0.0;
283 part { name: "over3";
286 description { state: "default" 0.0;
290 part { name: "clipper";
292 description { state: "default" 0.0;
293 color: 255 255 255 255;
296 part { name: "disabler";
298 description { state: "default" 0.0;
302 description { state: "disabled" 0.0;
303 inherit: "default" 0.0;
311 public button_state = BUTTON_STATE_ENABLED;
313 program { name: "button_click";
314 signal: "mouse,down,1";
316 action: SIGNAL_EMIT "elm,action,press" "";
317 after: "button_click_anim";
319 program { name: "button_click_anim";
320 action: STATE_SET "clicked" 0.0;
321 target: "button_image";
322 after: "text_clicked";
324 program { name: "text_clicked";
328 get_state(PART:"elm.text", st, 30, vl);
329 if (!strcmp(st, "visible"))
330 set_state(PART:"elm.text", "clicked", 0.0);
333 program { name: "button_unpress";
334 action: SIGNAL_EMIT "elm,action,unpress" "";
336 program { name: "button_mouseout_clicked";
337 signal: "mouse,up,1";
342 get_state(PART:"elm.swallow.content", st, 30, vl);
343 if (strcmp(st, "icononly"))
345 emit("elm,action,default,text,set", "");
346 set_state(PART:"elm.text", "visible", 0.0);
348 if (get_int(button_state) != BUTTON_STATE_DISABLED)
349 set_state(PART:"button_image", "default", 0.0);
351 after: button_unpress;
354 program { name: "button_unclick3";
355 action: SIGNAL_EMIT "elm,action,click" "";
357 program { name: "text_show";
358 signal: "elm,state,text,visible";
363 get_state(PART:"elm.swallow.content", st, 30, vl);
364 if (!strcmp(st, "icononly"))
366 set_state(PART:"elm.swallow.content", "visible", 0.0);
367 set_state(PART:"icon_rect", "visible", 0.0);
368 set_state(PART:"padding_after_icon", "visible", 0.0);
369 set_state(PART:"bg", "visible", 0.0);
371 if (get_int(button_state) != BUTTON_STATE_DISABLED)
372 set_state(PART:"elm.text", "visible", 0.0);
374 set_state(PART:"elm.text", "disabled_visible", 0.0);
377 program { name: "text_hide";
378 signal: "elm,state,text,hidden";
383 get_state(PART:"elm.swallow.content", st, 30, vl);
384 if (!strcmp(st, "visible"))
386 set_state(PART:"elm.swallow.content", "icononly", 0.0);
387 set_state(PART:"icon_rect", "icononly", 0.0);
388 set_state(PART:"padding_after_icon", "icononly", 0.0);
389 set_state(PART:"bg", "icononly", 0.0);
391 set_state(PART:"elm.text", "default", 0.0);
394 program { name: "icon_show";
395 signal: "elm,state,icon,visible";
400 get_state(PART:"elm.text", st, 30, vl);
401 if (!strcmp(st, "visible"))
403 set_state(PART:"elm.swallow.content", "visible", 0.0);
404 set_state(PART:"icon_rect", "visible", 0.0);
405 set_state(PART:"padding_after_icon", "visible", 0.0);
406 set_state(PART:"bg", "visible", 0.0);
410 set_state(PART:"elm.swallow.content", "icononly", 0.0);
411 set_state(PART:"icon_rect", "icononly", 0.0);
412 set_state(PART:"padding_after_icon", "icononly", 0.0);
413 set_state(PART:"bg", "icononly", 0.0);
418 program { name: "icon_hide";
419 signal: "elm,state,icon,hidden";
421 action: STATE_SET "default" 0.0;
422 target: "elm.swallow.content";
423 target: "padding_after_icon";
427 program { name: "disable";
428 signal: "elm,state,disabled";
430 action: STATE_SET "disabled" 0.0;
431 target: "button_image";
433 after: "disable_text";
435 program { name: "disable_text";
439 get_state(PART:"elm.text", st, 30, vl);
440 if (!strcmp(st, "visible"))
441 set_state(PART:"elm.text", "disabled_visible", 0.0);
443 set_state(PART:"elm.text", "disabled", 0.0);
444 set_int(button_state, BUTTON_STATE_DISABLED);
447 program { name: "enable";
448 signal: "elm,state,enabled";
450 action: STATE_SET "default" 0.0;
451 target: "button_image";
453 after: "enable_text";
455 program { name: "enable_text";
459 get_state(PART:"elm.text", st, 30, vl);
460 if (!strcmp(st, "disabled_visible"))
461 set_state(PART:"elm.text", "visible", 0.0);
463 set_state(PART:"elm.text", "default", 0.0);
464 set_int(button_state, BUTTON_STATE_ENABLED);
467 program { name: "focused";
468 //signal: "elm,action,focus";
470 action: STATE_SET "focused" 0.0;
471 target: "button_image";
474 program { name: "unfocused";
475 //signal: "elm,action,unfocus";
477 action: STATE_SET "default" 0.0;
478 target: "button_image";
479 after: "unfocus_text";
481 program { name: "unfocus_text";
482 action: STATE_SET "visible" 0.0;