feat(calendar): add the header directly into the calendar widget

In v8.0 the header was a detached object which made it difficult to move the header and the calendar
together. Besides there were no way to notifi the header of the calendar's shown date has changed.

BREAKING CHANGE: API of cleander headers, the appearence of the calendars

related to #2573"
This commit is contained in:
Gabor Kiss-Vamosi
2021-10-25 18:38:51 +02:00
parent b59cc9cfb8
commit 2e08f80361
10 changed files with 174 additions and 122 deletions

View File

@@ -4,7 +4,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;
@@ -41,10 +41,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);
}
#endif