theme: add arc and preload style to some themes

This commit is contained in:
Gabor Kiss-Vamosi
2018-09-20 22:14:33 +02:00
parent 5f14079695
commit f7d8cfd5c8
4 changed files with 77 additions and 0 deletions

View File

@@ -106,6 +106,14 @@ typedef struct {
lv_style_t *gauge;
#endif
#if USE_LV_ARC != 0
lv_style_t *arc;
#endif
#if USE_LV_PRELOAD != 0
lv_style_t *preload;
#endif
#if USE_LV_SW != 0
struct {
lv_style_t *bg;

View File

@@ -314,6 +314,29 @@ 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 = 10;
arc.line.color = lv_color_hsv_to_rgb(_hue, 90, 90);
arc.body.border.width = 10;
arc.body.border.color = lv_color_hsv_to_rgb(_hue, 30, 90);
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
@@ -760,6 +783,8 @@ lv_theme_t * lv_theme_material_init(uint16_t hue, lv_font_t * font)
lmeter_init();
gauge_init();
chart_init();
arc_init();
preload_init();
calendar_init();
cb_init();
btnm_init();

View File

@@ -176,6 +176,24 @@ static void gauge_init(void)
#endif
}
static void arc_init(void)
{
#if USE_LV_ARC != 0
theme.arc = &def;
#endif
}
static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = &def;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
@@ -386,6 +404,8 @@ lv_theme_t * lv_theme_templ_init(uint16_t hue, lv_font_t * font)
sw_init();
lmeter_init();
gauge_init();
arc_init();
preload_init();
chart_init();
cb_init();
btnm_init();

View File

@@ -292,6 +292,28 @@ 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 = 10;
arc.line.color = lv_color_hsv_to_rgb(_hue, 40, 90);
arc.body.border.width = 0;
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
@@ -733,6 +755,8 @@ lv_theme_t * lv_theme_zen_init(uint16_t hue, lv_font_t * font)
sw_init();
lmeter_init();
gauge_init();
arc_init();
preload_init();
chart_init();
calendar_init();
cb_init();