mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
copy default style modifiers to all themes
This commit is contained in:
parent
8ec60fbe3e
commit
3c7b6ae94c
@ -806,6 +806,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -862,6 +906,9 @@ lv_theme_t * lv_theme_alien_init(uint16_t hue, lv_font_t * font)
|
|||||||
table_init();
|
table_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,6 +355,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -406,6 +450,9 @@ lv_theme_t * lv_theme_default_init(uint16_t hue, lv_font_t * font)
|
|||||||
tabview_init();
|
tabview_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,6 +785,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -843,6 +887,9 @@ lv_theme_t * lv_theme_material_init(uint16_t hue, lv_font_t * font)
|
|||||||
table_init();
|
table_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,6 +412,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -467,6 +511,9 @@ lv_theme_t * lv_theme_mono_init(uint16_t hue, lv_font_t * font)
|
|||||||
tabview_init();
|
tabview_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -781,6 +781,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -836,6 +880,9 @@ lv_theme_t * lv_theme_nemo_init(uint16_t hue, lv_font_t * font)
|
|||||||
table_init();
|
table_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,6 +695,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -753,6 +797,9 @@ lv_theme_t * lv_theme_night_init(uint16_t hue, lv_font_t * font)
|
|||||||
table_init();
|
table_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,6 +364,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -419,6 +463,9 @@ lv_theme_t * lv_theme_templ_init(uint16_t hue, lv_font_t * font)
|
|||||||
tabview_init();
|
tabview_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,6 +758,50 @@ static void win_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void style_mod(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_ORANGE;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void style_mod_edit(lv_style_t * style)
|
||||||
|
{
|
||||||
|
#if LV_COLOR_DEPTH != 1
|
||||||
|
/*Make the style to be a little bit orange*/
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_GREEN;
|
||||||
|
|
||||||
|
/*If not empty or has border then emphasis the border*/
|
||||||
|
if (style->body.empty == 0 || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;
|
||||||
|
|
||||||
|
style->body.main_color = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.grad_color = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);
|
||||||
|
|
||||||
|
style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
|
||||||
|
#else
|
||||||
|
style->body.border.opa = LV_OPA_COVER;
|
||||||
|
style->body.border.color = LV_COLOR_BLACK;
|
||||||
|
style->body.border.width = 3;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@ -816,6 +860,9 @@ lv_theme_t * lv_theme_zen_init(uint16_t hue, lv_font_t * font)
|
|||||||
table_init();
|
table_init();
|
||||||
win_init();
|
win_init();
|
||||||
|
|
||||||
|
theme.group.style_mod = style_mod;
|
||||||
|
theme.group.style_mod_edit = style_mod_edit;
|
||||||
|
|
||||||
return &theme;
|
return &theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user