From 9eb33f6a3fadfd4a2f9396a7454db43914bc78d4 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 27 Oct 2021 16:19:03 -0400 Subject: [PATCH] [stm32l475][lvgl]update lv_demo.c --- .../stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c index 01536328b8..a80d06db1d 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c @@ -26,7 +26,7 @@ static void event_handler(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_target(e); + lv_obj_t * obj = lv_event_get_current_target(e); if(code == LV_EVENT_VALUE_CHANGED) { lv_calendar_date_t date; @@ -40,7 +40,7 @@ void lv_example_calendar_1(void) { lv_obj_t * calendar = lv_calendar_create(lv_scr_act()); lv_obj_set_size(calendar, LCD_W, LCD_H); - lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 60); + lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 0); lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL); lv_calendar_set_today_date(calendar, 2021, 02, 23); @@ -63,10 +63,11 @@ void lv_example_calendar_1(void) lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3); #if LV_USE_CALENDAR_HEADER_DROPDOWN - lv_calendar_header_dropdown_create(lv_scr_act(), calendar); + lv_calendar_header_dropdown_create(calendar); #elif LV_USE_CALENDAR_HEADER_ARROW - lv_calendar_header_arrow_create(lv_scr_act(), calendar, 25); + lv_calendar_header_arrow_create(calendar); #endif + lv_calendar_set_showed_date(calendar, 2021, 10); } static void lvgl_thread(void *parameter) -- GitLab