From 501c879833b4d95dc227966460f4bccd5e35107a Mon Sep 17 00:00:00 2001 From: Michal Skorupinski Date: Tue, 28 Mar 2017 12:30:51 +0200 Subject: [PATCH] [UI] Button style updated according to guide. Change-Id: I32d3d545f6ed3c11383372d3be8909be6b4b08fd Signed-off-by: Michal Skorupinski --- include/define.h | 15 +++++++++++---- res/view/base.edc | 1 + res/widget/button.edc | 31 ++++++++++++++++++++++++------- src/common/menumgr.c | 8 ++++++++ 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/include/define.h b/include/define.h index 2a98ef4..478372e 100644 --- a/include/define.h +++ b/include/define.h @@ -141,17 +141,24 @@ /* Color */ #define COLOR_ITEM_BG 191 191 191 255 -#define COLOR_ITEM_FOCUS 0 119 246 255 +#define COLOR_ITEM_FOCUS 191 191 191 255 +#define COLOR_ITEM_SELECTED 0 119 246 255 + #define COLOR_ITEM_BORDER 194 194 194 255 #define COLOR_ITEM_WHITE 255 255 255 255 +#define COLOR_TEXT_ITEM 92 92 92 255 +#define COLOR_TEXT_FOCUS 92 92 92 255 +#define COLOR_TEXT_SELECTED 255 255 255 255 -#define COLOR_TEXT_ITEM 255 255 255 255 -#define COLOR_TEXT_FOCUS 255 255 255 255 #define COLOR_TEXT_DISABLE 92 92 92 155 #define COLOR_TEXT_VALUE 89 89 89 255 -#define COLOR_TEXT_VALUE_FOCUS 189 189 189 255 + +#define COLOR_TEXT_VALUE_ITEM 0 129 198 255 +#define COLOR_TEXT_VALUE_FOCUS 0 129 198 255 +#define COLOR_TEXT_VALUE_SELECTED 255 255 255 255 + #define COLOR_TEXT_VALUE_DISABLE 64 136 211 155 #define COLOR_TEXT_SLIDER 92 92 92 255 #define COLOR_TEXT_SLIDER_VALUE 64 136 211 255 diff --git a/res/view/base.edc b/res/view/base.edc index 4041aca..9f58d71 100644 --- a/res/view/base.edc +++ b/res/view/base.edc @@ -76,6 +76,7 @@ group { state: "default" 0.0; rel1.relative: 0.0510 0.3648; rel2.relative: 0.9490 0.6370; + align: 0.5 0.5; } } part { diff --git a/res/widget/button.edc b/res/widget/button.edc index 6a65402..503edab 100644 --- a/res/widget/button.edc +++ b/res/widget/button.edc @@ -560,20 +560,33 @@ group { } parts { part { + name: "area"; + type: RECT; + scale: 0; + description { + state: "default" 0.0; + min: 428 294; + color: 0 0 128 128; + align: 0.0 0.0; + } + } + part { name, "bg"; type, RECT; scale: 0; description { state, "default" 0.0; - min, 428 294; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; color, COLOR_ITEM_BG; - align, 0.0 0.0; - fixed, 1 1; + align, 0.5 0.5; } description { state, "focused" 0.0; inherit, "default" 0.0; - color, COLOR_ITEM_FOCUS; + rel1.relative: -0.0368 -0.0377; + rel2.relative: 1.0368 1.0377; + color: COLOR_ITEM_FOCUS; } } part { @@ -600,7 +613,7 @@ group { rel2.to, "bg.content"; text { font, FONT_LIGHT; - size, 40; + size, 32; align, 0.5 0.5; } color, COLOR_TEXT_ITEM; @@ -694,10 +707,14 @@ group { relative, 0.0 0.5; } rel2.to, "bg.content"; + + color: COLOR_TEXT_VALUE_ITEM; text { align, 0.5 0.0; - style, style.subtext2; +// style, style.subtext2; + font: "BreezeSans:style=Light"; + size: 68; } } description { @@ -780,7 +797,7 @@ group { } part { name, PART_MENU_VALUE; - type, TEXTBLOCK; + type, TEXT; repeat_events, 1; scale: 0; description { diff --git a/src/common/menumgr.c b/src/common/menumgr.c index 2f68aef..2403e24 100755 --- a/src/common/menumgr.c +++ b/src/common/menumgr.c @@ -107,12 +107,20 @@ static void _focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item) { struct menumgr *m = (struct menumgr *)data; + Elm_Focus_Direction focus_dir[] = {ELM_FOCUS_LEFT, ELM_FOCUS_RIGHT, ELM_FOCUS_UP, ELM_FOCUS_DOWN}; + int i; + Evas_Object *neighbour; if (!obj || !m) return; if (m->info[id] && m->info[id]->focused) m->info[id]->focused(m->data, id); + + for (i = 0; i < sizeof(focus_dir) / sizeof(focus_dir[0]); ++i) { + neighbour = elm_object_focus_next_object_get(obj, i); + evas_object_stack_above(obj, neighbour); + } } static input_handler _handler = { -- 2.7.4