Added custom button styles. 88/51688/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Wed, 11 Nov 2015 08:06:48 +0000 (10:06 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 12 Nov 2015 07:18:28 +0000 (09:18 +0200)
Change-Id: I2490de34858537a421b7226d896c47a11fdf7c60
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-common/res/common/CMakeLists.txt
lib-common/res/common/edje/CommonButtons.h [new file with mode: 0644]
lib-common/res/common/edje/CommonPath.h
lib-common/res/common/edje/CommonThumbnail.h
lib-common/res/common/edje/common-buttons.edc [new file with mode: 0644]
lib-common/res/common/edje/common-colors.edc

index b0f0350..39c617f 100644 (file)
@@ -1,4 +1,4 @@
-set(EDCFILES common-thumbnail.edc)
+set(EDCFILES common-thumbnail.edc common-buttons.edc)
 set(EDJDIR "${RESDIR}/common/edje")
 
 foreach(EDCFILE ${EDCFILES})
diff --git a/lib-common/res/common/edje/CommonButtons.h b/lib-common/res/common/edje/CommonButtons.h
new file mode 100644 (file)
index 0000000..54f5bbf
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#ifndef COMMON_BUTTONS_H
+#define COMMON_BUTTONS_H
+
+#include "CommonPath.h"
+
+#define COMMON_BUTTONS_EDJ          COMMON_EDJ_DIR"common-buttons.edj"
+
+#define BUTTON_STYLE_CUSTOM_DEFAULT "custom_default"
+#define BUTTON_STYLE_CUSTOM_CIRCLE  "custom_circle"
+
+#define BUTTON_TEXT_CLASS           "button_text"
+#define BUTTON_COLOR_CLASS_NORMAL   "button_normal"
+#define BUTTON_COLOR_CLASS_PRESSED  "button_pressed"
+
+#endif /* COMMON_BUTTONS_H */
index 8e19ab3..2c6816c 100644 (file)
 #define COMMON_IMG_DIR "common/images/"
 #define COMMON_EDJ_DIR "common/edje/"
 
-#define COMMON_THUMBNAIL_EDJ        COMMON_EDJ_DIR"common-thumbnail.edj"
-
-#define THUMBNAIL_DEFAULT_MEDIUM    COMMON_IMG_DIR"contacts_caller_id_default.png"
-#define THUMBNAIL_DEFAULT_SMALL     COMMON_IMG_DIR"contacts_caller_id_default_02.png"
-#define THUMBNAIL_DEFAULT_LARGE     COMMON_IMG_DIR"contacts_caller_id_default_03.png"
-
-#define THUMBNAIL_BG_MEDIUM         COMMON_IMG_DIR"contacts_caller_id_default_bg.png"
-#define THUMBNAIL_BG_SMALL          COMMON_IMG_DIR"contacts_caller_id_default_bg_02.png"
-#define THUMBNAIL_BG_LARGE          COMMON_IMG_DIR"contacts_caller_id_default_bg_03.png"
-
 #endif /* COMMON_PATH_H */
index a548def..86e6332 100644 (file)
 
 #include "CommonPath.h"
 
+#define COMMON_THUMBNAIL_EDJ            COMMON_EDJ_DIR"common-thumbnail.edj"
+
+#define THUMBNAIL_DEFAULT_MEDIUM        COMMON_IMG_DIR"contacts_caller_id_default.png"
+#define THUMBNAIL_DEFAULT_SMALL         COMMON_IMG_DIR"contacts_caller_id_default_02.png"
+#define THUMBNAIL_DEFAULT_LARGE         COMMON_IMG_DIR"contacts_caller_id_default_03.png"
+
+#define THUMBNAIL_BG_MEDIUM             COMMON_IMG_DIR"contacts_caller_id_default_bg.png"
+#define THUMBNAIL_BG_SMALL              COMMON_IMG_DIR"contacts_caller_id_default_bg_02.png"
+#define THUMBNAIL_BG_LARGE              COMMON_IMG_DIR"contacts_caller_id_default_bg_03.png"
+
 #define GROUP_THUMBNAIL_SMALL           "thumbnail_small"
 #define GROUP_THUMBNAIL_MEDIUM          "thumbnail_medium"
 #define GROUP_THUMBNAIL_LARGE           "thumbnail_large"
diff --git a/lib-common/res/common/edje/common-buttons.edc b/lib-common/res/common/edje/common-buttons.edc
new file mode 100644 (file)
index 0000000..c0d227f
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#include "common-colors.edc"
+
+#define BUTTON_CORNER_RADIUS "35"
+#define BUTTON_DEFAULT_H 78
+#define BUTTON_TEXT_H 54
+#define BUTTON_TEXT_X 20
+#define BUTTON_TEXT_Y ((BUTTON_DEFAULT_H-BUTTON_TEXT_H)/2)
+
+#define BUTTON_CIRCLE_SIZE 98
+#define BUTTON_CONTENT_SIZE 60
+#define BUTTON_CONTENT_REL (((BUTTON_CIRCLE_SIZE-BUTTON_CONTENT_SIZE)/2)/BUTTON_CIRCLE_SIZE)
+
+styles {
+       style {
+               name: "button_main";
+               base: "font=Tizen:style=Light font_size=40 align=center color=#ffffffff text_class="BUTTON_TEXT_CLASS" ellipsis=1.0";
+       }
+}
+
+collections {
+       base_scale: 2.6;
+
+       group {
+               name: "elm/button/base/custom";
+
+               parts {
+                       part {
+                               name: "tizen_vg_shape";
+                               type: SWALLOW;
+                               scale: 1;
+                               clip_to: "bg";
+                               description {
+                                       state: "default" 0.0;
+                               }
+                       }
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               description {
+                                       state: "default" 0.0;
+                                       color_class: BUTTON_COLOR_CLASS_NORMAL;
+                               }
+                               description {
+                                       state: "pressed" 0.0;
+                                       color_class: BUTTON_COLOR_CLASS_PRESSED;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "pressed";
+                               signal: "mouse,down,*";
+                               source: "*";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "bg";
+                       }
+                       program {
+                               name: "unpressed";
+                               signal: "mouse,up,*";
+                               source: "*";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                       }
+                       program {
+                               name: "clicked";
+                               signal: "mouse,clicked,*";
+                               source: "*";
+                               action: SIGNAL_EMIT "elm,action,click" "";
+                       }
+               }
+       }
+
+       group {
+               name: "elm/button/base/"BUTTON_STYLE_CUSTOM_DEFAULT;
+               inherit: "elm/button/base/custom";
+               data.item: "vector_ux" "default";
+               data.item: "corner_radius" BUTTON_CORNER_RADIUS;
+
+               parts {
+                       part {
+                               name: "elm.text";
+                               type: TEXTBLOCK;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 {
+                                               relative: 0.0 (BUTTON_TEXT_Y/BUTTON_DEFAULT_H);
+                                               offset: BUTTON_TEXT_X 0;
+                                       }
+                                       rel2 {
+                                               relative: 1.0 (1.0-(BUTTON_TEXT_Y/BUTTON_DEFAULT_H));
+                                               offset: -BUTTON_TEXT_X 0;
+                                       }
+                                       text {
+                                               style: "button_main";
+                                               min: 1 1;
+                                               ellipsis: -1;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       group {
+               name: "elm/button/base/"BUTTON_STYLE_CUSTOM_CIRCLE;
+               inherit: "elm/button/base/custom";
+               data.item: "vector_ux" "circle";
+
+               parts {
+                       part {
+                               name: "elm.swallow.content";
+                               type: SWALLOW;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1.relative: BUTTON_CONTENT_REL BUTTON_CONTENT_REL;
+                                       rel2.relative: (1.0-BUTTON_CONTENT_REL) (1.0-BUTTON_CONTENT_REL);
+                               }
+                       }
+               }
+       }
+}
index 2c4d380..5871eb3 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#include "CommonButtons.h"
+
 color_classes {
        color_class { //A03O003
                name: "thumbnail_bg";
@@ -24,4 +26,12 @@ color_classes {
                name: "thumbnail_default";
                color:  61 185 204 128;
        }
+       color_class {
+               name: BUTTON_COLOR_CLASS_NORMAL;
+               color: 0 0 0 45;
+       }
+       color_class {
+               name: BUTTON_COLOR_CLASS_PRESSED;
+               color: 0 0 0 75;
+       }
 }