From d2dfabee3fc23ab91950f51fb21f16af28b8e0d0 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 21 Sep 2018 06:56:37 +0200 Subject: [PATCH] theme updates --- lv_conf_templ.h | 4 +++- lv_themes/lv_theme_night.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/lv_conf_templ.h b/lv_conf_templ.h index 9e71db0ec..f28bd76a2 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -263,7 +263,9 @@ /*Button (dependencies: lv_cont*/ #define USE_LV_BTN 1 - +#if USE_LV_BTN != 0 +#define LV_BTN_INK_EFFECT 1 /*1: enable ink effect animation on click. Use `lv_btn_set_ink_in/wait/out_time` to set the animation time*/ +#endif /*Image Button (dependencies: lv_btn*/ #define USE_LV_IMGBTN 1 diff --git a/lv_themes/lv_theme_night.c b/lv_themes/lv_theme_night.c index f8e814e52..6db77e78e 100644 --- a/lv_themes/lv_theme_night.c +++ b/lv_themes/lv_theme_night.c @@ -278,6 +278,34 @@ static void gauge_init(void) #endif } +static void arc_init(void) +{ +#if USE_LV_ARC != 0 + + static lv_style_t arc; + lv_style_copy(&arc, &def); + arc.line.width = 8; + arc.line.color = lv_color_hsv_to_rgb(_hue, 80, 70); + arc.line.rounded = 1; + + /*For preloader*/ + arc.body.border.width = 7; + arc.body.border.color = lv_color_hsv_to_rgb(_hue, 11, 48); + arc.body.padding.hor = 1; + arc.body.padding.ver = 1; + + theme.arc = &arc; +#endif +} + +static void preload_init(void) +{ +#if USE_LV_PRELOAD != 0 + + theme.preload = theme.arc; +#endif +} + static void chart_init(void) { #if USE_LV_CHART @@ -667,6 +695,8 @@ lv_theme_t * lv_theme_night_init(uint16_t hue, lv_font_t * font) sw_init(); lmeter_init(); gauge_init(); + arc_init(); + preload_init(); chart_init(); calendar_init(); cb_init();