From 2dba1c03c0fbeabdf88ddcc7a7f7970dea456da8 Mon Sep 17 00:00:00 2001 From: Michal Skorupinski Date: Mon, 15 May 2017 16:40:18 +0200 Subject: [PATCH] [UI] Focus state updated for the date/time buttons. Change-Id: I0a0e53d515f1031779275475a762d1829547af13 Signed-off-by: Michal Skorupinski --- ...cused.9.png => bg_settings_clock_focused.#.png} | Bin ...essed.9.png => bg_settings_clock_pressed.#.png} | Bin ...shadow.9.png => bg_settings_clock_shadow.#.png} | Bin res/widget/button.edc | 126 ++++++++++++++++++++- src/view/system/view_clock.c | 4 +- 5 files changed, 127 insertions(+), 3 deletions(-) rename res/images/4.0/{bg_settings_clock_focused.9.png => bg_settings_clock_focused.#.png} (100%) rename res/images/4.0/{bg_settings_clock_pressed.9.png => bg_settings_clock_pressed.#.png} (100%) rename res/images/4.0/{bg_settings_clock_shadow.9.png => bg_settings_clock_shadow.#.png} (100%) diff --git a/res/images/4.0/bg_settings_clock_focused.9.png b/res/images/4.0/bg_settings_clock_focused.#.png similarity index 100% rename from res/images/4.0/bg_settings_clock_focused.9.png rename to res/images/4.0/bg_settings_clock_focused.#.png diff --git a/res/images/4.0/bg_settings_clock_pressed.9.png b/res/images/4.0/bg_settings_clock_pressed.#.png similarity index 100% rename from res/images/4.0/bg_settings_clock_pressed.9.png rename to res/images/4.0/bg_settings_clock_pressed.#.png diff --git a/res/images/4.0/bg_settings_clock_shadow.9.png b/res/images/4.0/bg_settings_clock_shadow.#.png similarity index 100% rename from res/images/4.0/bg_settings_clock_shadow.9.png rename to res/images/4.0/bg_settings_clock_shadow.#.png diff --git a/res/widget/button.edc b/res/widget/button.edc index 12b3c2e..6b5da8a 100755 --- a/res/widget/button.edc +++ b/res/widget/button.edc @@ -27,7 +27,10 @@ group { name, "elm/button/base/style.menu.button"; - data.item, "focus_highlight" "on"; + data { + item: "focus_highlight" "on"; + + } script { public focused; public selected; @@ -824,6 +827,127 @@ group { } } +#define CLOCK_FOCUSED "4.0/bg_settings_clock_focused.#.png" +#define CLOCK_PRESSED "4.0/bg_settings_clock_pressed.#.png" +#define CLOCK_SHADOW "4.0/bg_settings_clock_shadow.#.png" + +group { + name, "elm/button/base/style.date_time.button"; + inherit, "elm/button/base/style.normal.button"; + data.item, "focus_highlight" "on"; + images { + image: CLOCK_FOCUSED COMP; + image: CLOCK_PRESSED COMP; + image: CLOCK_SHADOW RAW; + } + parts { + part { + name: "area"; + type: RECT; + scale: 0; + description { + state: "default" 0.0; + min: 388 80; + color: 0 0 0 0; + align: 0.0 0.0; + } + } + part { + name: "shadow"; + type: IMAGE; + scale: 0; + description { + state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + rel1.relative: -0.06 -0.3; + rel2.relative: 1.06 1.3; + color: 255 255 255 0; + align: 0.5 0.5; + image.normal: CLOCK_SHADOW; + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + color: 255 0 0 255; + } + description { + state, "mouse_down" 0.0; + inherit, "default" 0.0; + } + } + part { + name: "bg"; + type: IMAGE; + scale: 0; + description { + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + color: 255 255 255 0; + image.normal: CLOCK_FOCUSED; + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + color: 255 255 255 255; + image.normal: CLOCK_FOCUSED; + } + description { + state, "mouse_down" 0.0; + inherit, "default" 0.0; + color: 255 255 255 255; + image.normal: CLOCK_PRESSED; + } + } + part { + name, "bg.content"; + type, SPACER; + scale: 0; + description { + state, "default" 0.0; + max, 388 254; + rel1.to, "bg"; + rel2.to, "bg"; + align, 0.5 0.5; + fixed, 1 1; + } + } + part { + name, "elm.text"; + type, TEXT; + repeat_events, 1; + scale: 0; + description { + state, "default" 0.0; + rel1.relative, 0.0 0.1; + text { + font, FONT_LIGHT; + size, 32; + align, 0.5 0.2653; + } + color, COLOR_TEXT_ITEM; + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_FOCUS; + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_DISABLE; + } + description { + state, "mouse_down" 0.0; + inherit, "default" 0.0; + color, 255 255 255 255; + } + } + } +} group { name, "elm/button/base/style.datetime.status.button"; inherit, "elm/button/base/style.status.button"; diff --git a/src/view/system/view_clock.c b/src/view/system/view_clock.c index a5a0416..ef61af9 100755 --- a/src/view/system/view_clock.c +++ b/src/view/system/view_clock.c @@ -221,8 +221,8 @@ static bool _add_clock_setting(clock_view_priv_data *priv) /* TODO: For some reason, setting ampm to visible corrects the widget's layout without displaying AM/PM - remove it when datetime is fixed */ - priv->date_part = utils_add_button(priv->base, PART_MAIN_ITEM_DATE, "elm/button/base/style.normal.button", NULL); - priv->time_part = utils_add_button(priv->base, PART_MAIN_ITEM_TIME, "elm/button/base/style.normal.button", NULL); + priv->date_part = utils_add_button(priv->base, PART_MAIN_ITEM_DATE, "style.date_time.button", NULL); + priv->time_part = utils_add_button(priv->base, PART_MAIN_ITEM_TIME, "style.date_time.button", NULL); /* 24/12h check: */ priv->check_24 = elm_check_add(priv->base); -- 2.7.4