#define BUTTON_STATE_ENABLED 0 #define BUTTON_STATE_DISABLED 1 #define BUTTON_NAVIBAR_FUNCTION_BUTTON_TEXT_NORMAL_COLOR_INC 146 124 98 255 #define BUTTON_NAVIBAR_FUNCTION_BUTTON_TEXT_PRESSED_COLOR_INC 217 147 26 255 #define BUTTON_NAVIBAR_FUNCTION_BUTTON_TEXT_FOCUSED_COLOR_INC 217 147 26 255 #define BUTTON_NAVIBAR_FUNCTION_BUTTON_TEXT_DISABLED_COLOR_INC 160 151 145 255 #define BUTTON_NAVIBAR_CENTER_BG_NORMAL_MIN_W_INC 36 #define BUTTON_NAVIBAR_CENTER_BG_NORMAL_MIN_H_INC 74 #define BUTTON_NAVIBAR_CENTER_BG_NORMAL_BORDER_INC 4 4 4 4 #define BUTTON_NAVIBAR_CENTER_PADDING_MIN_MAX_INC 16 2 #define BUTTON_NAVIBAR_CENTER_ICON_RECT_VISIBLE_MIN_SIZE 36 36 #define BUTTON_NAVIBAR_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC 6 0 #define BUTTON_NAVIBAR_CENTER_PADDING_BEFORE_TEXT_DEFAULT_MIN_INC 6 0 #define BUTTON_NAVIBAR_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC 36 36 #define BUTTON_NAVIBAR_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC 38 38 #define BUTTON_NAVIBAR_CENTER_TEXT_FONT_SIZE_INC 32 #define BUTTON_NAVIBAR_MULTILINE_TEXT_FONT_SIZE_INC 24 #define BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC 106 40 #define BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC 36 32 #define NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC 3 3 3 255 #define NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC 52 52 52 255 #define BUTTON_TEXT_STYLE1_BG_MIN_INC 100 74 #define BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC 148 74 #define BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC 74 74 #define BUTTON_TEXT_STYLE1_BG_BORDER_INC 5 5 5 5 #define BUTTON_TEXT_STYLE1_PADDING_MIN_INC 5 5 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38 #define BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 38 38 #define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 38 38 #define BUTTON_TEXT_STYLE1_FONT_SIZE_INC 32 #define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 108 108 108 255 #define BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC 249 249 249 255 #define BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC 108 108 108 255 #define BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC 108 115 118 255 /////////////////////////////////////////////////////////////////////////////////////// group { name: "elm/button/base/video/style1"; alias: "elm/button/base/video/text_only/style1"; alias: "elm/button/base/video/center"; alias: "elm/button/base/video/icon_and_text/center"; alias: "elm/button/base/video/nocontents/search_button"; alias: "elm/button/base/video/naviframe/title/default"; images { image: "T01_title_btn.png" COMP; image: "T01_title_btn_press.png" COMP; } script { public button_state = BUTTON_STATE_ENABLED; } parts { part { name: "button_image"; scale: 1; description { state: "default" 0.0; image { normal: "T01_title_btn.png"; border: BUTTON_TEXT_STYLE1_BG_BORDER_INC; border_scale: 1; } } description { state: "clicked" 0.0; inherit: "default" 0.0; image { normal: "T01_title_btn_press.png"; } } description { state: "disabled" 0.0; inherit: "default" 0.0; image { normal: "T01_title_btn.png"; } } description { state: "focused" 0.0; inherit: "default" 0.0; image { normal: "T01_title_btn_press.png"; } } } part { name: "padding_left_top"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 0.0 0.0; rel2 { relative: 0.0 0.0; } min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; fixed: 1 1; visible: 0; } } part { name: "bg"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; min: BUTTON_TEXT_STYLE1_BG_MIN_INC; visible: 0; } description { state: "visible" 0.0; inherit: "default" 0.0; min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC; } description { state: "icononly" 0.0; inherit: "default" 0.0; min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC; } } part { name: "padding_right_bottom"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 1.0 1.0; rel1 { relative: 1.0 1.0; } min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; fixed: 1 1; visible: 0; } } part { name: "icon_rect"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; visible: 0; min: 0 0; fixed: 1 0; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } align: 0.0 0.5; } description { state: "visible" 0.0; visible: 0; min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; fixed: 1 0; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } align: 0.0 0.5; } description { state: "icononly" 0.0; inherit: "default" 0.0; } } part { name: "padding_after_icon"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; //when only icon or no icon is there align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { to: "icon_rect"; } fixed: 1 0; min: 0 0; visible: 0; } description { state: "visible" 0.0; visible: 0; align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { to: "icon_rect"; } fixed: 1 0; min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; } description { state: "icononly" 0.0; inherit: "default" 0.0; } } part { name: "padding_before_text"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; //when only icon or no icon is there align: 1.0 0.5; rel1 { relative: 0.0 1.0; to_x: "elm.text"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to_x: "elm.text"; to_y: "padding_right_bottom"; } fixed: 1 0; min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; visible: 0; } } part { name: "elm.swallow.content"; type: SWALLOW; scale: 1; clip_to: "clipper"; description { state: "default" 0.0; visible: 0; align: 0.0 0.5; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } fixed: 1 0; } description { state: "visible" 0.0; fixed: 1 0; min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; align: 1.0 0.5; rel1 { relative: 0.0 1.0; to_x: "padding_before_text"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to_x: "padding_before_text"; to_y: "padding_right_bottom"; } } description { state: "icononly" 0.0; min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; align: 0.5 0.5; } } part { name: "elm.text"; type: TEXT; mouse_events: 0; scale: 1; clip_to: "clipper"; description { state: "default" 0.0; visible: 0; rel1 { relative: 1.0 1.0; to_x: "padding_after_icon"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC; text { font: "SLP:style=Medium"; size: BUTTON_TEXT_STYLE1_FONT_SIZE_INC; min: 0 0; max: 1 0; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; } description { state: "clicked" 0.0; inherit: "default" 0.0; visible: 1; color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC; } description { state: "disabled" 0.0; inherit: "default" 0.0; color: 0 0 0 128; } description { state: "disabled_visible" 0.0; inherit: "default" 0.0; color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC; visible: 1; } description { state: "focused" 0.0; inherit: "default" 0.0; visible: 1; color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC; } } part { name: "over2"; type: RECT; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "over3"; type: RECT; repeat_events: 1; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "clipper"; type: RECT; description { state: "default" 0.0; color: 255 255 255 255; } } part { name: "disabler"; type: RECT; description { state: "default" 0.0; color: 0 0 0 0; visible: 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { name: "button_click"; signal: "mouse,down,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,press" ""; after: "button_click_anim"; } program { name: "button_click_anim"; action: STATE_SET "clicked" 0.0; target: "button_image"; after: "text_clicked"; } program { name: "text_clicked"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) set_state(PART:"elm.text", "clicked", 0.0); } } program { name: "button_unpress"; action: SIGNAL_EMIT "elm,action,unpress" ""; } program { name: "button_mouseout_clicked"; signal: "mouse,up,1"; source: "over3"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (strcmp(st, "icononly")) { emit("elm,action,default,text,set", ""); set_state(PART:"elm.text", "visible", 0.0); } if (get_int(button_state) != BUTTON_STATE_DISABLED) set_state(PART:"button_image", "default", 0.0); } after: button_unpress; } program { name: "button_unclick3"; signal: "mouse,clicked,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "icononly")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"icon_rect", "visible", 0.0); set_state(PART:"padding_after_icon", "visible", 0.0); set_state(PART:"bg", "visible", 0.0); } if (get_int(button_state) != BUTTON_STATE_DISABLED) set_state(PART:"elm.text", "visible", 0.0); else set_state(PART:"elm.text", "disabled_visible", 0.0); } } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"icon_rect", "icononly", 0.0); set_state(PART:"padding_after_icon", "icononly", 0.0); set_state(PART:"bg", "icononly", 0.0); } set_state(PART:"elm.text", "default", 0.0); } } program { name: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"icon_rect", "visible", 0.0); set_state(PART:"padding_after_icon", "visible", 0.0); set_state(PART:"bg", "visible", 0.0); } else { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"icon_rect", "icononly", 0.0); set_state(PART:"padding_after_icon", "icononly", 0.0); set_state(PART:"bg", "icononly", 0.0); } } } program { name: "icon_hide"; signal: "elm,state,icon,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.swallow.content"; target: "padding_after_icon"; target: "icon_rect"; target: "bg"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "button_image"; target: "disabler"; after: "disable_text"; } program { name: "disable_text"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) set_state(PART:"elm.text", "disabled_visible", 0.0); else set_state(PART:"elm.text", "disabled", 0.0); set_int(button_state, BUTTON_STATE_DISABLED); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; target: "button_image"; target: "disabler"; after: "enable_text"; } program { name: "enable_text"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "disabled_visible")) set_state(PART:"elm.text", "visible", 0.0); else set_state(PART:"elm.text", "default", 0.0); set_int(button_state, BUTTON_STATE_ENABLED); } } program { name: "focused"; //signal: "elm,action,focus"; //source: "elm"; action: STATE_SET "focused" 0.0; target: "button_image"; target: "elm.text"; } program { name: "unfocused"; //signal: "elm,action,unfocus"; //source: "elm"; action: STATE_SET "default" 0.0; target: "button_image"; after: "unfocus_text"; } program { name: "unfocus_text"; action: STATE_SET "visible" 0.0; target: "elm.text"; } } } /////////////////////////////////////////////////////////////////////////////////////// group { name: "elm/button/base/video/naviframe/back_btn/default"; alias: "elm/button/base/video/naviframe/prev_btn/default"; alias: "elm/button/base/video/naviframe/end_btn/default"; //TODO: Remove this alias later alias: "elm/button/base/video/navigationbar_prev_btn/default"; alias: "elm/button/base/video/navigationbar_backbutton/default"; alias: "elm/button/base/video/navigationbar_end_btn/default"; images { image: "T01_btn_prev.png" COMP; } parts { part { name: "button_image"; type: RECT; mouse_events: 1; scale: 1; description { state: "default" 0.0; min: BUTTON_NAVIBAR_BACK_BUTTON_BUTTON_IMAGE_MIN_INC; color: 0 0 0 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; } description { state: "disabled" 0.0; inherit: "default" 0.0; } } part {name: "padding_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; align: 1 0; min: 1 0; rel1 { relative: 1 0.2; } rel2 { relative: 1 0.8; } fixed: 1 0; color: NAVIBAR_TITLE_RIGHT_SEPARATOR_COLOR_INC; } } part {name: "padding_before_right"; type: RECT; mouse_events: 0; description { state: "default" 0.0; align: 1 0; min: 1 0; rel1 { relative: 0 0; to: "padding_right"; } rel2 { relative: 0 1; to: "padding_right"; } fixed: 1 0; color: NAVIBAR_TITLE_LEFT_SEPARATOR_COLOR_INC; } } part { name: "button_center_part"; mouse_events: 0; scale: 1; description { state: "default" 0.0; min: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; max: BUTTON_NAVIBAR_BACK_BUTTON_BG_MIN_MAX_INC; align: 0.5 0.5; rel2 { relative: 0 1; to_x: "padding_before_right"; } image { normal: "T01_btn_prev.png"; } } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "T01_btn_prev.png"; } } part { name: "over1"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "over2"; mouse_events: 1; repeat_events: 1; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "disabler"; type: RECT; description { state: "default" 0.0; color: 0 0 0 0; visible: 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { name: "button_click"; signal: "mouse,down,1"; source: "over1"; action: SIGNAL_EMIT "elm,action,press" ""; after: "button_click_anim"; } program { name: "button_click_anim"; action: STATE_SET "clicked" 0.0; target: "button_image"; target: "button_center_part"; } program { name: "button_unclick"; signal: "mouse,up,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,unpress" ""; after: "button_unclick_anim"; } program { name: "button_unclick_anim"; action: STATE_SET "default" 0.0; target: "button_image"; target: "button_center_part"; } program { name: "button_unclick2"; signal: "mouse,clicked,1"; source: "over1"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "disabler"; target: "button_image"; } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; target: "disabler"; target: "button_image"; } } } /////////////////////////////////////////////////////////////////////////////////////// group { name: "elm/button/base/naviframe_control/multiline"; alias: "elm/button/base/video/navigationbar_control/multiline"; script { public button_state = BUTTON_STATE_ENABLED; } images.image: "T01_title_btn.png" COMP; images.image: "T01_title_btn_press.png" COMP; styles{ style { name: "btn_multiline_navigationbar_controlbar_style"; base: "font=SLP:style=Medium font_size="BUTTON_NAVIBAR_MULTILINE_TEXT_FONT_SIZE_INC" align=center color=#ffffff wrap=mixed"; tag: "br" "\n"; tag: "ps" "ps"; tag: "tab" "\t"; } } parts { part { name: "button_image"; type: IMAGE; mouse_events: 1; scale: 1; description { state: "default" 0.0; min: BUTTON_NAVIBAR_CENTER_BG_NORMAL_MIN_W_INC BUTTON_NAVIBAR_CENTER_BG_NORMAL_MIN_H_INC; rel1.offset: 0 0; rel2.offset: -1 -1; image.normal: "T01_title_btn.png"; image.border: BUTTON_NAVIBAR_CENTER_BG_NORMAL_BORDER_INC; color: 255 255 255 255; } description { state: "disabled" 0.0; inherit: "default" 0.0; image.normal: "T01_title_btn.png"; } description { state: "clicked" 0.0; inherit: "default" 0.0; image.normal: "T01_title_btn_press.png"; } } part { name: "padding_left_top"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 0.0 0.0; rel1 { relative: 0.0 0.0; } rel2 { relative: 0.0 0.0; } min: BUTTON_NAVIBAR_CENTER_PADDING_MIN_MAX_INC; fixed: 1 1; visible: 0; } } part { name: "padding_right_bottom"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; align: 1.0 1.0; rel1.relative: 1.0 1.0; rel2.relative: 1.0 1.0; min: BUTTON_NAVIBAR_CENTER_PADDING_MIN_MAX_INC; fixed: 1 1; visible: 0; } } part { name: "icon_rect"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; visible: 0; min: 0 0; fixed: 1 0; rel1 { relative: 0.0 1.0; to_x: "elm.swallow.content"; to_y: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "elm.swallow.content"; to_y: "padding_right_bottom"; } align: 0.0 0.5; } } part { name: "padding_icon_text"; type: RECT; scale: 1; mouse_events: 0; description { state: "default" 0.0; //when only icon or no icon is there visible: 0; align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { relative: 1.0 1.0; to: "icon_rect"; } fixed: 1 0; min: 0 0; } description { state: "visible" 0.0; inherit: "default" 0.0; min: BUTTON_NAVIBAR_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC; rel1 { relative: 1.0 0.0; to: "icon_rect"; } rel2 { relative: 1.0 1.0; to: "icon_rect"; } } description { state: "icononly" 0.0; inherit: "default" 0.0; } } part { name: "elm.swallow.content"; type: SWALLOW; scale: 1; clip_to: "clipper"; description { state: "default" 0.0; visible: 0; align: 0.0 0.5; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 1.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } fixed: 1 0; } description { state: "visible" 0.0; fixed: 1 0; visible: 1; min: BUTTON_NAVIBAR_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; max: BUTTON_NAVIBAR_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; align: 0.0 0.5; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 0.0 0.0; to_x: "padding_left_top"; to_y: "padding_right_bottom"; } } description { state: "icononly" 0.0; visible: 1; min: BUTTON_NAVIBAR_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; max: BUTTON_NAVIBAR_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; rel1 { relative: 1.0 1.0; to: "padding_left_top"; } rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } align: 0.5 0.5; } } part { name: "elm.text"; type: TEXTBLOCK; mouse_events: 0; scale: 1; clip_to: "clipper"; description { state: "default" 0.0; visible: 0; rel1 { relative: 1.0 1.0; to_x: "padding_icon_text"; to_y: "padding_left_top"; } rel2 { relative: 0.0 0.0; to: "padding_right_bottom"; } align: 0.5 0.5; color: 255 255 255 255; text { style: "btn_multiline_navigationbar_controlbar_style"; min: 0 0; max: 0 1; } } description { state: "visible" 0.0; inherit: "default" 0.0; visible: 1; min: 80 0; } description { state: "clicked" 0.0; inherit: "default" 0.0; visible: 1; min: 0 0; } description { state: "focused" 0.0; inherit: "default" 0.0; visible: 1; min: 0 0; color: 255 255 255 255; } } part { name: "over2"; type: RECT; mouse_events: 1; repeat_events: 1; ignore_flags: ON_HOLD; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "over3"; type: RECT; mouse_events: 1; repeat_events: 1; description { state: "default" 0.0; color: 0 0 0 0; } } part { name: "clipper"; type: RECT; description { state: "default" 0.0; color: 255 255 255 255; } description { state: "disabled" 0.0; color: 255 255 255 127; } } part { name: "disabler"; type: RECT; description { state: "default" 0.0; color: 0 0 0 0; visible: 0; } description { state: "disabled" 0.0; inherit: "default" 0.0; visible: 1; } } } programs { program { name: "button_click"; signal: "mouse,down,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,press" ""; after: "button_click_anim"; } program { name: "button_click_anim"; action: STATE_SET "clicked" 0.0; target: "button_image"; after: "text_clicked"; } program { name: "text_clicked"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) set_state(PART:"elm.text", "clicked", 0.0); } } program { name: "button_unpress"; action: SIGNAL_EMIT "elm,action,unpress" ""; } program { name: "button_mouseout_clicked"; signal: "mouse,up,1"; source: "over3"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (strcmp(st, "icononly")) { emit("elm,action,default,text,set", ""); set_state(PART:"elm.text", "visible", 0.0); } if(get_int(button_state) != BUTTON_STATE_DISABLED) set_state(PART:"button_image", "default", 0.0); } after: button_unpress; } program { name: "button_unclick3"; signal: "mouse,clicked,1"; source: "over2"; action: SIGNAL_EMIT "elm,action,click" ""; } program { name: "text_show"; signal: "elm,state,text,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "icononly")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"padding_icon_text", "visible", 0.0); } set_state(PART:"elm.text", "visible", 0.0); } } program { name: "text_hide"; signal: "elm,state,text,hidden"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.swallow.content", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"padding_icon_text", "icononly", 0.0); } set_state(PART:"elm.text", "default", 0.0); } } program { name: "icon_show"; signal: "elm,state,icon,visible"; source: "elm"; script { new st[31]; new Float:vl; get_state(PART:"elm.text", st, 30, vl); if (!strcmp(st, "visible")) { set_state(PART:"elm.swallow.content", "visible", 0.0); set_state(PART:"padding_icon_text", "visible", 0.0); } else { set_state(PART:"elm.swallow.content", "icononly", 0.0); set_state(PART:"padding_icon_text", "icononly", 0.0); } } } program { name: "icon_hide"; signal: "elm,state,icon,hidden"; source: "elm"; action: STATE_SET "default" 0.0; target: "elm.swallow.content"; target: "padding_icon_text"; } program { name: "disable"; signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; target: "button_image"; target: "clipper"; target: "disabler"; after: "disable_text"; } program { name: "disable_text"; script { set_int(button_state, BUTTON_STATE_DISABLED); set_state(PART:"elm.text", "visible", 0.0); } } program { name: "enable"; signal: "elm,state,enabled"; source: "elm"; action: STATE_SET "default" 0.0; target: "button_image"; target: "clipper"; target: "disabler"; after: "enable_text"; } program { name: "enable_text"; script { set_int(button_state, BUTTON_STATE_ENABLED); set_state(PART:"elm.text", "visible", 0.0); } } program { name: "focused"; action: STATE_SET "focused" 0.0; target: "button_image"; target: "elm.text"; } program { name: "unfocused"; action: STATE_SET "default" 0.0; target: "button_image"; after: "unfocus_text"; } program { name: "unfocus_text"; action: STATE_SET "visible" 0.0; target: "elm.text"; } } }