[check] add rightmost check style
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Fri, 7 Oct 2011 09:04:55 +0000 (18:04 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Fri, 7 Oct 2011 09:04:55 +0000 (18:04 +0900)
themes/groups/check.edc

index 4365b64..21d0fea 100644 (file)
@@ -301,6 +301,281 @@ CHECK_STYLE_DEFAULT("default", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_IN
 ////////////////////////////////////////////////////////////////////////////////
 CHECK_STYLE_DEFAULT("default/extended", CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
 ////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+#define CHECK_STYLE_DEFAULT_RIGHTMOST(style_name, min_width, min_height) \
+ group { name: "elm/check/base/"style_name; \
+      images { \
+         image: "00_check_bg.png" COMP; \
+         image: "00_check_bg_dim.png" COMP; \
+         image: "00_check_checking.png" COMP; \
+      } \
+      script { \
+         public check_state = CHECK_STATE_DEFAULT; \
+      } \
+      parts { \
+         part { name: "back_bg"; \
+            type: RECT; \
+            mouse_events: 1; \
+            scale: 1; \
+            description { state: "default" 0.0; \
+               align: 1.0 0.5; \
+               min: min_width min_height; \
+               fixed: 0 0; \
+               visible: 1; \
+               color: 0 0 0 0; \
+            } \
+         } \
+         part { name: "bg"; \
+            mouse_events: 0; \
+            scale: 1; \
+            description { state: "default" 0.0; \
+               min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
+               max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
+               fixed: 1 1; \
+               rel1{ to: "back_bg"; } \
+               rel2{ to: "back_bg"; } \
+               align: 1.0 0.5; \
+               visible: 1; \
+               image { \
+                  normal: "00_check_bg.png"; \
+               } \
+               fill.smooth : 0; \
+            } \
+            description { state: "disabled" 0.0; \
+               inherit: "default" 0.0; \
+               image { \
+                  normal: "00_check_bg_dim.png"; \
+               } \
+               fill.smooth : 0; \
+            } \
+         } \
+         part { name: "check"; \
+            mouse_events: 0; \
+            scale: 1; \
+            description { state: "default" 0.0; \
+               rel1.to: "bg"; \
+               rel2.to: "bg"; \
+               visible: 0; \
+               image.normal: "00_check_checking.png"; \
+            } \
+            description { state: "visible" 0.0; \
+               inherit: "default" 0.0; \
+               visible: 1; \
+            } \
+            description { state: "disabled_visible" 0.0; \
+               inherit: "default" 0.0; \
+               visible: 1; \
+            } \
+         } \
+         part { name: "elm.swallow.content"; \
+            type: SWALLOW; \
+            description { state: "default" 0.0; \
+               fixed: 1 0; \
+               visible: 0; \
+               color: 255 255 255 255; \
+               align: 0.0 0.5; \
+               rel1.to_x: "bg"; \
+               rel1.relative: 1.0 0.0; \
+               rel1.offset: 1 1; \
+               rel2.to_x: "bg"; \
+               rel2.relative: 1.0 1.0; \
+               rel2.offset: 2 -2; \
+            } \
+            description { state: "visible" 0.0; \
+               inherit: "default" 0.0; \
+               fixed: 1 1; \
+               visible: 1; \
+               aspect: 1.0 1.0; \
+               aspect_preference: VERTICAL; \
+            } \
+            description { state: "disabled" 0.0; \
+               inherit: "default" 0.0; \
+               color: 128 128 128 128; \
+            } \
+            description { state: "disabled_visible" 0.0; \
+               inherit: "default" 0.0; \
+               color: 128 128 128 128; \
+               fixed: 1 1; \
+               visible: 1; \
+               aspect: 1.0 1.0; \
+            } \
+         } \
+         part { name: "elm.text"; \
+            type: TEXTBLOCK; \
+            mouse_events: 0; \
+            scale: 1; \
+            description { state: "default" 0.0; \
+               visible: 0; \
+               fixed: 0 1; \
+               rel1 { relative: 1.0 0.5; offset: 1 1; to_x: "elm.swallow.content"; } \
+               rel2 { relative: 1.0 0.5; offset: -2 -2; } \
+               align: 0.0 0.5; \
+               text { \
+                  style: "check_label_textblock_style"; \
+                  min: 0 0; \
+               } \
+               color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
+            } \
+            description { state: "visible" 0.0; \
+               inherit: "default" 0.0; \
+               visible: 1; \
+               text.min: 1 1; \
+            } \
+            description { state: "disabled" 0.0; \
+               inherit: "default" 0.0; \
+            } \
+            description { state: "disabled_visible" 0.0; \
+               inherit: "default" 0.0; \
+               visible: 1; \
+               text.min: 1 1; \
+               color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
+            } \
+         } \
+         part { name: "events1"; \
+            type: RECT; \
+            ignore_flags: ON_HOLD; \
+            description { state: "default" 0.0; \
+               color: 0 0 0 0; \
+            } \
+         } \
+         part { name: "events2"; \
+            type: RECT; \
+            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: "click"; \
+            signal: "mouse,clicked,1"; \
+            source: "events1"; \
+            action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
+         } \
+         program { name: "check_on"; \
+            signal: "elm,state,check,on"; \
+            source: "elm"; \
+            script { \
+               set_int(check_state, CHECK_STATE_VISIBLE); \
+               set_state(PART:"check", "visible", 0.0); \
+            } \
+         } \
+         program { name: "check_off"; \
+            signal: "elm,state,check,off"; \
+            source: "elm"; \
+            action:  STATE_SET "default" 0.0; \
+            target: "check"; \
+            script { \
+               if(get_int(check_state) == CHECK_STATE_VISIBLE) \
+               { \
+                  set_int(check_state, CHECK_STATE_DEFAULT); \
+                  set_state(PART:"check", "default", 0.0); \
+               } \
+            } \
+         } \
+         program { name: "text_show"; \
+            signal: "elm,state,text,visible"; \
+            source: "elm"; \
+            action:  STATE_SET "visible" 0.0; \
+            target: "elm.text"; \
+         } \
+         program { name: "text_hide"; \
+            signal: "elm,state,text,hidden"; \
+            source: "elm"; \
+            action:  STATE_SET "default" 0.0; \
+            target: "elm.text"; \
+         } \
+         program { name: "icon_show"; \
+            signal: "elm,state,icon,visible"; \
+            source: "elm"; \
+            action:  STATE_SET "visible" 0.0; \
+            target: "elm.swallow.content"; \
+         } \
+         program { name: "icon_hide"; \
+            signal: "elm,state,icon,hidden"; \
+            source: "elm"; \
+            action:  STATE_SET "default" 0.0; \
+            target: "elm.swallow.content"; \
+         } \
+         program { name: "disable"; \
+            signal: "elm,state,disabled"; \
+            source: "elm"; \
+            action: STATE_SET "disabled" 0.0; \
+            target: "disabler"; \
+            target: "bg"; \
+            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); \
+               get_state(PART:"elm.swallow.content", st, 30, vl); \
+               if (!strcmp(st, "visible")) \
+                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
+               else \
+                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
+               get_state(PART:"check", st, 30, vl); \
+               if (!strcmp(st, "visible")) \
+               { \
+                  set_state(PART:"check", "disabled_visible", 0.0); \
+                  set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
+               } \
+            } \
+         } \
+         program { name: "enable"; \
+            signal: "elm,state,enabled"; \
+            source: "elm"; \
+            action: STATE_SET "default" 0.0; \
+            target: "disabler"; \
+            target: "bg"; \
+            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); \
+               get_state(PART:"elm.swallow.content", st, 30, vl); \
+               if (!strcmp(st, "visible")) \
+                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
+               else \
+                  set_state(PART:"elm.swallow.content", "default", 0.0); \
+               get_state(PART:"check", st, 30, vl); \
+               if (!strcmp(st, "disabled_visible")) \
+               { \
+                  set_state(PART:"check", "visible", 0.0); \
+                  set_int(check_state, CHECK_STATE_VISIBLE); \
+               } \
+               else \
+                  set_int(check_state, CHECK_STATE_DEFAULT); \
+            } \
+         } \
+      } \
+   }
+////////////////////////////////////////////////////////////////////////////////
+CHECK_STYLE_DEFAULT_RIGHTMOST("default/rightmost", CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
+////////////////////////////////////////////////////////////////////////////////
+
    group { name: "elm/check/base/multicheck";
       images {
          image: "00_check_bg.png" COMP;