feat(example) add style examples

This commit is contained in:
Gabor Kiss-Vamosi
2021-05-27 11:50:04 +02:00
parent 5bc529bc46
commit 0cafde653d
22 changed files with 461 additions and 177 deletions

View File

@@ -2,7 +2,7 @@
#if LV_BUILD_EXAMPLES
/**
* Using the Shadow style properties
* Using the outline style properties
*/
void lv_example_style_4(void)
{
@@ -12,13 +12,12 @@ void lv_example_style_4(void)
/*Set a background color and a radius*/
lv_style_set_radius(&style, 5);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 3));
lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1));
/*Add a shadow*/
lv_style_set_shadow_width(&style, 8);
lv_style_set_shadow_color(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_shadow_ofs_x(&style, 10);
lv_style_set_shadow_ofs_y(&style, 20);
/*Add outline*/
lv_style_set_outline_width(&style, 2);
lv_style_set_outline_color(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_outline_pad(&style, 8);
/*Create an object with the new style*/
lv_obj_t * obj = lv_obj_create(lv_scr_act());
@@ -27,3 +26,4 @@ void lv_example_style_4(void)
}
#endif