Apply algorithm color on favorite item 13/48913/1 accepted/tizen/tv/20151005.055320 submit/tizen/20151005.003307
authorjinwoo.shin <jw0227.shin@samsung.com>
Thu, 1 Oct 2015 10:58:54 +0000 (19:58 +0900)
committerjinwoo.shin <jw0227.shin@samsung.com>
Thu, 1 Oct 2015 10:58:54 +0000 (19:58 +0900)
Change-Id: I67b7ebf903d3232435de2993662355f3c5097275
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
data/widget/button.edc
include/define.h
res/images/ic_default_tv.png
src/util.c
src/view_action_menu.c

index 9e745dc..fdc20e4 100644 (file)
@@ -1026,6 +1026,19 @@ group {
                        }
                }
                part {
+                       name: "elm.swallow.content_bg";
+                       type: SWALLOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1.relative: 0.0 0.0;
+                               rel2.relative: 1.0 0.0;
+                               align: 0.0 0.0;
+                               min: 440 210;
+                               fixed: 1 1;
+                       }
+               }
+               part {
                        name: "elm.swallow.content";
                        type: SWALLOW;
                        scale: 1;
@@ -1039,6 +1052,19 @@ group {
                        }
                }
                part {
+                       name: "elm.swallow.text_bg";
+                       type: SWALLOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1.relative: 0.0 1.0;
+                               rel2.relative: 1.0 1.0;
+                               min: 440 82;
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+               part {
                        name: "content.border_top";
                        type: RECT;
                        mouse_events: 0;
@@ -1114,22 +1140,25 @@ group {
                        }
                }
                part {
-                       name: "text.bg";
+                       name: "content.border_bottom";
                        type: RECT;
+                       mouse_events: 0;
                        scale: 1;
                        description {
                                state: "default" 0.0;
-                               rel1.relative: 0.0 1.0;
-                               rel2.relative: 1.0 1.0;
-                               min: 440 82;
-                               align: 0.0 1.0;
-                               color: 100 100 100 255;
+                               rel1 {
+                                       to: "elm.swallow.content";
+                                       relative: 0.0 1.0;
+                               }
+                               align: 0.0 0.0;
+                               color: 0 119 246 255;
                                fixed: 1 1;
+                               visible: 0;
                        }
                        description {
                                state: "focused" 0.0;
                                inherit: "default" 0.0;
-                               color: 0 119 246 255;
+                               visible: 1;
                        }
                }
                part {
@@ -1139,11 +1168,11 @@ group {
                        description {
                                state: "default" 0.0;
                                rel1 {
-                                       to: "text.bg";
+                                       to: "elm.swallow.text_bg";
                                        relative: 0.5 0.5;
                                }
                                rel2 {
-                                       to: "text.bg";
+                                       to: "elm.swallow.text_bg";
                                        relative: 0.5 0.5;
                                }
                                text {
@@ -1176,7 +1205,7 @@ group {
                        target: "content.border_top";
                        target: "content.border_left";
                        target: "content.border_right";
-                       target: "text.bg";
+                       target: "content.border_bottom";
                }
                program {
                        name: "go_passive";
@@ -1187,7 +1216,7 @@ group {
                        target: "content.border_top";
                        target: "content.border_left";
                        target: "content.border_right";
-                       target: "text.bg";
+                       target: "content.border_bottom";
                }
                program {
                        name, "mouse_unclick_after";
index 40d9be3..ce3bfb0 100644 (file)
@@ -32,6 +32,8 @@
 #define PART_ICON_1_FOCUSED "elm.swallow.icon.1.focus"
 #define PART_ICON_1_SELECTED "elm.swallow.icon.1.select"
 #define PART_ICON_1_DISABLED "elm.swallow.icon.1.disable"
+#define PART_TEXT_BG "elm.swallow.text_bg"
+#define PART_CONTENT_BG "elm.swallow.content_bg"
 
 #define SOURCE_PROGRAM "program"
 #define SOURCE_ELM "elm"
index eed7a94..7fc30a1 100644 (file)
Binary files a/res/images/ic_default_tv.png and b/res/images/ic_default_tv.png differ
index 272c63e..888fc02 100644 (file)
@@ -123,7 +123,7 @@ Evas_Object *util_add_icon(Evas_Object *parent, const char *file,
        if (part)
                elm_object_part_content_set(parent, part, ic);
 
-       elm_image_fill_outside_set(ic, EINA_TRUE);
+       elm_image_resizable_set(ic, EINA_FALSE, EINA_TRUE);
 
        evas_object_show(ic);
 
index c998f29..b66b36c 100644 (file)
@@ -20,6 +20,7 @@
 #include <app_control.h>
 #include <app_debug.h>
 #include <app_define.h>
+#include <app_contents.h>
 
 #include "define.h"
 #include "util.h"
@@ -442,6 +443,31 @@ static void _update_channel_info(struct _priv *priv)
        tv_channel_del_info(channel_info);
 }
 
+static void _add_favorite_bg(Evas_Object *btn, char *str)
+{
+       Evas_Object *bg;
+       struct color_data bright, dark;
+
+       app_contents_get_color(str, &bright, &dark);
+       bg = evas_object_rectangle_add(btn);
+       if (!bg) {
+               _ERR("failed to add content bg");
+               return;
+       }
+       evas_object_color_set(bg, bright.r, bright.g,
+                       bright.b, bright.a);
+       elm_object_part_content_set(btn, PART_CONTENT_BG, bg);
+
+       bg = evas_object_rectangle_add(btn);
+       if (!bg) {
+               _ERR("failed to add text bg");
+               return;
+       }
+       evas_object_color_set(bg, dark.r, dark.g,
+                       dark.b, dark.a);
+       elm_object_part_content_set(btn, PART_TEXT_BG, bg);
+}
+
 static void _update_favorite(struct _priv *priv)
 {
        Eina_List *channel_list, *l;
@@ -488,9 +514,11 @@ static void _update_favorite(struct _priv *priv)
                }
 
                util_add_icon(btn, IMAGE_FAVORITE_DEFAULT, PART_CONTENT);
+               _add_favorite_bg(btn, buf);
+
                inputmgr_add_callback(btn, channel_info->service_id,
                                &favorite_handler, NULL);
-               inputmgr_set_tags(btn, TAG_FAVORITE, VIEW_ACTION_MENU);
+               inputmgr_set_tags(btn, VIEW_ACTION_MENU, TAG_FAVORITE, NULL);
 
                elm_box_pack_end(priv->favorite, btn);