diff options
-rw-r--r-- | data/widget/button.edc | 51 | ||||
-rw-r--r-- | include/define.h | 2 | ||||
-rw-r--r-- | res/images/ic_default_tv.png | bin | 647828 -> 394 bytes | |||
-rw-r--r-- | src/util.c | 2 | ||||
-rw-r--r-- | src/view_action_menu.c | 30 |
5 files changed, 72 insertions, 13 deletions
diff --git a/data/widget/button.edc b/data/widget/button.edc index 9e745dc..fdc20e4 100644 --- a/data/widget/button.edc +++ b/data/widget/button.edc @@ -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"; diff --git a/include/define.h b/include/define.h index 40d9be3..ce3bfb0 100644 --- a/include/define.h +++ b/include/define.h @@ -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" diff --git a/res/images/ic_default_tv.png b/res/images/ic_default_tv.png Binary files differindex eed7a94..7fc30a1 100644 --- a/res/images/ic_default_tv.png +++ b/res/images/ic_default_tv.png @@ -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); diff --git a/src/view_action_menu.c b/src/view_action_menu.c index c998f29..b66b36c 100644 --- a/src/view_action_menu.c +++ b/src/view_action_menu.c @@ -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); |