api(align) save align in style and handle x/y according to it

This commit is contained in:
Gabor Kiss-Vamosi
2021-03-25 16:14:17 +01:00
parent 53f3cc1827
commit a2f3022188
92 changed files with 271 additions and 197 deletions

View File

@@ -8,18 +8,18 @@ void lv_example_led_1(void)
{
/*Create a LED and switch it OFF*/
lv_obj_t * led1 = lv_led_create(lv_scr_act());
lv_obj_align(led1, NULL, LV_ALIGN_CENTER, -80, 0);
lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0);
lv_led_off(led1);
/*Copy the previous LED and set a brightness*/
lv_obj_t * led2 = lv_led_create(lv_scr_act());
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0);
lv_led_set_brightness(led2, 150);
lv_led_set_color(led2, lv_color_red());
/*Copy the previous LED and switch it ON*/
lv_obj_t * led3 = lv_led_create(lv_scr_act());
lv_obj_align(led3, NULL, LV_ALIGN_CENTER, 80, 0);
lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0);
lv_led_on(led3);
}