--- /dev/null
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define BUTTON_PADDING_SIZE_INC 30 0
+#define BUTTON_ICON_SIZE_INC 30 30
+#define BUTTON_POPUP_SIZE_INC 220 220
+
+collections {
+ base_scale: 1.8;
+ styles {
+ style { name: "button_general_text_normal";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=36 align=center color=#FAFAFAFF ellipsis=1.0 wrap=mixed text_class=tizen";
+ }
+ style { name: "button_general_text_dim";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=36 align=center color=#FAFAFA89 ellipsis=1.0 wrap=mixed text_class=tizen";
+ }
+ style { name: "button_general_text_press";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=36 align=center color=#FAFAFAFF ellipsis=1.0 wrap=mixed text_class=tizen";
+ }
+ style { name: "button_general_text_focused";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=36 align=center color=#FAFAFAFF ellipsis=1.0 wrap=mixed text_class=tizen";
+ }
+ }
+
+ group { name: "elm/button/base/popup_circle";
+ images {
+ image: "wifi_ap_forget_btn.png" COMP;
+ }
+ script {
+ public mouse_down = 0;
+ public multi_down = 0;
+ }
+ parts {
+ part { name: "padding";
+ type: "SPACER";
+ scale: 1;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 0 0;
+ rel1.relative: 0.5 1.0;
+ rel2.relative: 0.5 1.0;
+ align: 0.5 0.0;
+ }
+ }
+ part { name: "bg";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: BUTTON_POPUP_SIZE_INC;
+ image.normal: "wifi_ap_forget_btn.png";
+ rel1.to: "padding";
+ rel1.relative: 0.5 1.0;
+ rel2.to: "padding";
+ rel2.relative: 0.5 1.0;
+ align: 0.5 1.0;
+ color: 0 44 76 255;
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 0.0;
+ color: 0 148 255 127;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 33 33 33 255;
+ }
+ }
+
+ part { name: "padding_left_top";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ rel2.relative: 0.0 0.0;
+ min: BUTTON_PADDING_SIZE_INC;
+ fixed: 1 1;
+ }
+ }
+ part { name: "padding_right_bottom";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 1.0 1.0;
+ rel1.relative: 1.0 1.0;
+ min: BUTTON_PADDING_SIZE_INC;
+ fixed: 1 1;
+ }
+ }
+ part { name: "icon_rect";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.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";
+ }
+ min: 0 0;
+ fixed: 1 1;
+ }
+ description { state: "visible" 0.0;
+ inherit: "default" 0.0;
+ min: BUTTON_ICON_SIZE_INC;
+ max: BUTTON_ICON_SIZE_INC;
+ fixed: 1 1;
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ clip_to: "elm.swallow.content.clip";
+ scale: 1;
+ 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 1;
+ min: BUTTON_ICON_SIZE_INC;
+ max: BUTTON_ICON_SIZE_INC;
+ 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";
+ }
+ }
+ description { state: "icononly" 0.0;
+ min: BUTTON_ICON_SIZE_INC;
+ max: BUTTON_ICON_SIZE_INC;
+ }
+ }
+ part { name: "padding_text";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 20;
+ rel1 {
+ to: "padding_left_top";
+ relative: 0.0 1.0;
+ }
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.5 1.0;
+ rel1 {
+ relative: 1.0 0.2;
+ to_x: "icon_rect";
+ //to_y: "padding_left_top";
+ to_y: "padding_text";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "padding_right_bottom";
+ }
+ text {
+ max: 1 0;
+ style: "button_general_text_normal";
+ }
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ text.style: "button_general_text_dim";
+ }
+ description { state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ text.style: "button_general_text_press";
+ }
+ }
+ part { name: "elm.swallow.content.clip";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ color: 0 148 255 255;
+ }
+ description { state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 250 250 250 76;
+ }
+ }
+ part { name: "event";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1.to: "bg";
+ rel2.to: "bg";
+ }
+ }
+ }
+ programs {
+ program { name: "pressed";
+ signal: "mouse,down,1*";
+ source: "event";
+ script {
+ if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
+ {
+ set_int(mouse_down, 1);
+ run_program(PROGRAM:"button_press1");
+ }
+ }
+ }
+ program { name: "button_press1";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"bg", st, 30, vl);
+ if (strcmp(st, "disabled")) {
+ set_state(PART:"bg", "pressed", 0.0);
+ set_state(PART:"elm.text", "pressed", 0.0);
+ emit("elm,action,press", "");
+ }
+ }
+ }
+ program { name: "unpressed";
+ signal: "mouse,up,1";
+ source: "event";
+ script {
+ if (get_int(mouse_down) == 1) {
+ set_int(mouse_down, 0);
+ run_program(PROGRAM:"button_unpress1");
+ }
+ }
+ }
+ program { name: "button_unpress1";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"bg", st, 30, vl);
+ if (strcmp(st, "disabled")) {
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"elm.text", "default", 0.0);
+ emit("elm,action,unpress", "");
+ }
+ }
+ }
+ program { name: "touch_snd";
+ signal: "mouse,clicked,1";
+ source: "event";
+ script {
+ new st[31];
+ new Float:vl;
+ if (get_int(multi_down) == 0) {
+ get_state(PART:"bg", st, 30, vl);
+ if (strcmp(st, "disabled")) {
+ run_program(PROGRAM:"play_sample");
+ emit("elm,action,click", "");
+ }
+ }
+ }
+ }
+ program {
+ name: "play_sample";
+ action: RUN_PLUGIN "touch_sound";
+ }
+ 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);
+ }
+ get_state(PART:"bg", st, 30, vl);
+ if (strcmp(st, "disabled"))
+ set_state(PART:"elm.text", "default", 0.0);
+ else
+ set_state(PART:"elm.text", "disabled", 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", "default", 0.0);
+ }
+ set_state(PART:"elm.text", "default", 0.0);
+ }
+ }
+ program { name: "icon_show";
+ signal: "elm,state,icon,visible";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "elm.swallow.content";
+ target: "icon_rect";
+ }
+ program { name: "icon_hide";
+ signal: "elm,state,icon,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.swallow.content";
+ target: "icon_rect";
+ }
+ program { name: "disable";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "bg";
+ target: "elm.swallow.content.clip";
+ target: "elm.text";
+ }
+ program { name: "enable";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.swallow.content.clip";
+ target: "elm.text";
+ }
+ program { name: "multi_down";
+ signal: "elm,action,multi,down";
+ source: "elm";
+ script {
+ set_int(multi_down, 1);
+ }
+ }
+ program { name: "multi_up";
+ signal: "elm,action,multi,up";
+ source: "elm";
+ script {
+ set_int(multi_down, 0);
+ }
+ }
+ }
+ }
+}