Update category button 64/44364/3
authorjinwoo.shin <jw0227.shin@samsung.com>
Tue, 21 Jul 2015 06:45:04 +0000 (15:45 +0900)
committerjinwoo.shin <jw0227.shin@samsung.com>
Tue, 21 Jul 2015 07:12:22 +0000 (16:12 +0900)
Change-Id: Ie4d09f5a8f1bf29816e2d0f42802ae67ece41dc1
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
data/infosquare-theme.edc
data/view/notification_view.edc
data/widget/button.edc [new file with mode: 0644]
src/notification_view.c

index f92291c..1a3c9fa 100644 (file)
@@ -17,5 +17,6 @@
 #include "../include/define.h"
 
 collections {
+       #include "widget/button.edc"
        #include "widget/gengrid.edc"
 }
index ced0b19..d5d8b7e 100644 (file)
@@ -102,7 +102,7 @@ group {
                                        to_y, PART_NOTIFICATION_CONTENT_BG;
                                        relative, 1.0 0.0;
                                }
-                               min, 0 132;
+                               min, 0 116;
                                fixed, 1 1;
                        }
                        description {
@@ -125,7 +125,7 @@ group {
                                        to, "padding.notification.content";
                                        relative, 1.0 1.0;
                                }
-                               min, 0 678;
+                               min, 0 694;
                                align, 0.0 0.0;
                                fixed, 0 1;
                                visible, 1;
@@ -228,7 +228,7 @@ group {
                }
                part {
                        name, PART_NOTIFICATION_CATEGORY_TITLE;
-                       type, TEXT;
+                       type, SWALLOW;
                        scale, 1;
                        description {
                                state, "default" 0.0;
@@ -237,23 +237,10 @@ group {
                                        relative, 1.0 0.0;
                                }
                                rel2.relative, 1.0 0.0;
-                               text {
-                                       font, FONT_LIGHT;
-                                       size, 36;
-                                       align, 0.0 0.5;
-                                       min, 1 1;
-                                       ellipsis, -1;
-                               }
-                               min, 0 36;
-                               color, 77 77 77 255;
+                               min, 0 68;
                                align, 0.0 0.0;
                                fixed, 0 1;
                        }
-                       description {
-                               state, "focused" 0.0;
-                               inherit, "default" 0.0;
-                               color, 255 255 255 255;
-                       }
                }
                part {
                        name, "padding.notification.category.content";
diff --git a/data/widget/button.edc b/data/widget/button.edc
new file mode 100644 (file)
index 0000000..778cc35
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+#define TRANSITION_TIME 0.17
+#define COLOR_ITEM_FOCUS 0 119 246 255
+#define COLOR_TEXT_INDEX 77 77 77 255
+#define COLOR_TEXT_FOCUS 255 255 255 255
+
+group {
+       name: "elm/button/base/category_btn";
+       data.item: "focus_highlight" "on";
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               color: 0 0 0 0;
+                       }
+               }
+               part {
+                       name: "bg_text";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1.to: "padding.left_top";
+                               rel2.to: "padding.right_bottom";
+                               color: 0 0 0 0;
+                       }
+                       description {
+                               state: "focused" 0.0;
+                               inherit: "default" 0.0;
+                               color: COLOR_ITEM_FOCUS;
+                       }
+               }
+               part {
+            name: "padding.left_top";
+            type: SPACER;
+            description {
+                state: "default" 0.0;
+                rel1.relative: 0.0 0.0;
+                rel2.relative: 0.0 0.0;
+                align: 0.0 0.0;
+                min: 16 16;
+                fixed: 1 1;
+            }
+        }
+               part {
+            name: "padding.right_bottom";
+            type: SPACER;
+            description {
+                state: "default" 0.0;
+                rel1 {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                               }
+                rel2 {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                               }
+                align: 0.0 0.0;
+                min: 16 16;
+                fixed, 1 1;
+            }
+        }
+               part {
+                       name: "elm.text";
+                       type: TEXT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "padding.left_top";
+                                       relative: 1.0 1.0;
+                               }
+                               rel2 {
+                                       to: "padding.left_top";
+                                       relative: 1.0 1.0;
+                               }
+                               text {
+                                       font: FONT_LIGHT;
+                                       size: 36;
+                                       min: 1 0;
+                                       align: 0.0 0.7;
+                                       ellipsis: -1;
+                               }
+                               min: 0 36;
+                               align: 0.0 0.0;
+                               color: COLOR_TEXT_INDEX;
+                               fixed: 1 1;
+                       }
+                       description {
+                               state: "focused" 0.0;
+                               inherit: "default" 0.0;
+                               text.font: FONT_REGULAR;
+                               color: COLOR_TEXT_FOCUS;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       action: STATE_SET "focused" 0.0;
+                       target: "bg_text";
+                       target: "elm.text";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       action: STATE_SET "default" 0.0;
+                       target: "bg_text";
+                       target: "elm.text";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+       }
+}
index 01326f5..c4e9490 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "define.h"
 
+#define STYLE_CATEGORY_TITLE "category_btn"
 #define STYLE_GRID_ITEM "notification_item"
 
 #define NOTIFICATION_CATEGORY_PADDING_X 62
@@ -93,6 +94,23 @@ static const char *_get_category_title(int category)
        }
 }
 
+static void _draw_category_title(Evas_Object *base, int category)
+{
+       Evas_Object *btn;
+
+       btn = elm_button_add(base);
+       if (!btn) {
+               _ERR("failed to create button object");
+               return;
+       }
+
+       elm_object_style_set(btn, STYLE_CATEGORY_TITLE);
+       elm_object_text_set(btn, _get_category_title(category));
+
+       elm_object_part_content_set(base,
+                       PART_NOTIFICATION_CATEGORY_TITLE, btn);
+}
+
 static void _draw_category(struct _priv *priv, int category,
                notification_list_h noti_list)
 {
@@ -110,8 +128,7 @@ static void _draw_category(struct _priv *priv, int category,
        elm_layout_file_set(ly, EDJEFILE, GRP_NOTIFICATION_CATEGORY);
        evas_object_size_hint_align_set(ly, 0.0, 0.0);
 
-       elm_object_part_text_set(ly, PART_NOTIFICATION_CATEGORY_TITLE,
-                       _get_category_title(category));
+       _draw_category_title(ly, category);
 
        priv->category[category] = elm_gengrid_add(ly);
        elm_gengrid_item_size_set(priv->category[category],
@@ -305,9 +322,9 @@ static void _show(void *view_data)
 
        priv = (struct _priv *) view_data;
 
-       _update_list(priv);
-
        evas_object_show(priv->base);
+
+       _update_list(priv);
 }
 
 static void _hide(void *view_data)