Applied the customized style to menu button 39/42639/1
authorHyojung Jo <hj903.jo@samsung.com>
Wed, 1 Jul 2015 05:47:18 +0000 (14:47 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Wed, 1 Jul 2015 05:47:18 +0000 (14:47 +0900)
Change-Id: Iccb6fc9c7486534249452e56c2dec5355f7d3eda
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/define.h
res/apps-theme.edc
res/widget/button.edc [new file with mode: 0644]
src/view/view_base.c

index 3b3e7ee2035cb1a2f6553c76051b2400f12e5a84..3d9fca076c81d0c1557e6c7e72679c580c2fefb8 100644 (file)
 #define PART_MENU "part.menu"
 #define PART_SORT "part.sort"
 
+/* Style */
+#define STYLE_MENU_BTN "style.menu.button"
+
+/* Font */
+#define FONT_TIZENSANS_REGULAR "TizenSans"
+#define FONT_TIZENSANS_LIGHT "TizenSans:style=Light"
+
 /* String */
 #define STR_APPS "Apps"
 #define STR_MYAPPS "My Apps"
index 2d81a0b1d45a5d23bc623789a967b7c4ced3a111..f4862722138cf42011ad98a17f57f18721bd1315 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "../include/define.h"
+
 collections {
-       /* It should be implemented later. */
+       #include "widget/button.edc"
 }
diff --git a/res/widget/button.edc b/res/widget/button.edc
new file mode 100644 (file)
index 0000000..1bb024c
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+group {
+       name, "elm/button/base/style.menu.button";
+       data.item, "focus_highlight" "on";
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 240 82;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 0 119 246 255;
+                       }
+               }
+
+               part {
+                       name, "elm.text";
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 104 104 104 255;
+                               min, 0 82;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                               text {
+                                       font, FONT_TIZENSANS_LIGHT;
+                                       size, 32;
+                                       align, 0.5 0.5;
+                               }
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               color, 64 136 211 255;
+                               text.font, FONT_TIZENSANS_REGULAR;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
+                               text.font, FONT_TIZENSANS_REGULAR;
+                       }
+               }
+
+               part {
+                       name, "padding.bottom.line";
+                       type, SPACER;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 28 3;
+                               rel1 {
+                                       to, "bg";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2 {
+                                       to, "bg";
+                                       relative, 0.0 1.0;
+                               }
+                               align, 0.0 1.0;
+                               fixed, 1 1;
+                       }
+               }
+
+               part {
+                       name, "bottom.line";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 64 136 211 255;
+                               min, 184 3;
+                               rel1 {
+                                       to, "padding.bottom.line";
+                                       relative, 1.0 0.0;
+                               }
+                               rel2 {
+                                       to, "padding.bottom.line";
+                                       relative, 1.0 0.0;
+                               }
+                               align, 0.0 0.0;
+                               fixed, 1 1;
+                               visible, 0;
+                       }
+                       description {
+                               state, "selected" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                       }
+               }
+       }
+
+       programs{
+               program {
+                       name, "focused";
+                       signal, "elm,action,focus";
+                       source, "elm";
+                       action, STATE_SET "focused" 0.0;
+                       target, "bg";
+                       target, "elm.text";
+                       target, "bottom.line";
+                       transition, LINEAR 0.17;
+               }
+
+               program {
+                       name, "unfocused";
+                       signal, "elm,action,unfocus";
+                       source, "elm";
+                       action, STATE_SET "default" 0.0;
+                       target, "bg";
+                       target, "elm.text";
+                       target, "bottom.line";
+                       transition, LINEAR 0.17;
+               }
+       }
+}
index 43e398697a0ac0b0470da38c39f0c9d878109c41..d174d06cbdaf33e135ef3c78aaa608e27e2ce098 100644 (file)
@@ -104,7 +104,7 @@ static bool _draw_top_area(struct _priv *priv)
        }
 
        for (i = 0; i < MENU_COUNT; i++) {
-               btn = add_button(priv->base, NULL, str_menu[i], NULL);
+               btn = add_button(priv->base, NULL, str_menu[i], STYLE_MENU_BTN);
                if (!btn) {
                        _ERR("elm_button_add failed.");
                        evas_object_del(box);
@@ -123,6 +123,8 @@ static bool _draw_top_area(struct _priv *priv)
        elm_object_focus_next_object_set(priv->menu_btn[MENU_COUNT -1],
                        priv->menu_btn[0], ELM_FOCUS_RIGHT);
 
+       elm_object_focus_set(priv->menu_btn[0], EINA_TRUE);
+
        return true;
 }