2021-04-08 13:07:48 +02:00
|
|
|
#include "../lv_examples.h"
|
2021-02-19 14:47:32 +01:00
|
|
|
#if LV_BUILD_EXAMPLES
|
|
|
|
|
|
|
|
/**
|
2021-05-27 11:50:04 +02:00
|
|
|
* Using the border style properties
|
2021-02-19 14:47:32 +01:00
|
|
|
*/
|
|
|
|
void lv_example_style_3(void)
|
|
|
|
{
|
|
|
|
static lv_style_t style;
|
|
|
|
lv_style_init(&style);
|
|
|
|
|
|
|
|
/*Set a background color and a radius*/
|
2021-05-27 11:50:04 +02:00
|
|
|
lv_style_set_radius(&style, 10);
|
2021-02-19 14:47:32 +01:00
|
|
|
lv_style_set_bg_opa(&style, LV_OPA_COVER);
|
2021-05-27 11:50:04 +02:00
|
|
|
lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 1));
|
2021-02-19 14:47:32 +01:00
|
|
|
|
2021-05-27 11:50:04 +02:00
|
|
|
/*Add border to the bottom+right*/
|
|
|
|
lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE));
|
|
|
|
lv_style_set_border_width(&style, 5);
|
|
|
|
lv_style_set_border_opa(&style, LV_OPA_50);
|
|
|
|
lv_style_set_border_side(&style, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT);
|
2021-02-19 14:47:32 +01:00
|
|
|
|
|
|
|
/*Create an object with the new style*/
|
2023-10-12 20:37:27 +02:00
|
|
|
lv_obj_t * obj = lv_obj_create(lv_screen_active());
|
2021-03-31 19:57:14 +02:00
|
|
|
lv_obj_add_style(obj, &style, 0);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_center(obj);
|
2021-02-19 14:47:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|