From a296456591f6ff0e3b3ae6cdcdd9ec5b1711c357 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 30 Aug 2023 15:59:08 +0200 Subject: [PATCH] docs(calendar): update according to v8.2 changes --- docs/widgets/extra/calendar.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/widgets/extra/calendar.md b/docs/widgets/extra/calendar.md index 5dd601d17..0fd3630f0 100644 --- a/docs/widgets/extra/calendar.md +++ b/docs/widgets/extra/calendar.md @@ -1,5 +1,7 @@ # Calendar (lv_calendar) +**From v8.1 the header is added directly into the Calendar widget and the API of the headers has been changed.** + ## Overview The Calendar object is a classic calendar which can: @@ -13,13 +15,16 @@ The Calendar is added to the default group (if it is set). Calendar is an editab To make the Calendar flexible, by default it doesn't show the current year or month. Instead, there are optional "headers" that can be attached to the calendar. ## Parts and Styles -The calendar object uses the [Button matrix](/widgets/core/btnmatrix) object under the hood to arrange the days into a matrix. -- `LV_PART_MAIN` The background of the calendar. Uses all the background related style properties. -- `LV_PART_ITEMS` Refers to the dates and day names. Button matrix control flags are set to differentiate the buttons and a custom drawer event is added modify the properties of the buttons as follows: - - day names have no border, no background and drawn with a gray color - - days of the previous and next month have `LV_BTNMATRIX_CTRL_DISABLED` flag - - today has a thicker border with the theme's primary color - - highlighted days have some opacity with the theme's primary color. +The Calendar is composed of 3 widegets +- Container: A rectangle which is a container for the *Header* and the *Days*. Uses only `LV_PART_MAIN` where all the background related style properties are working. +- Days: It's a [Button matrix](/widgets/core/btnmatrix) object under the hood to arrange the days into a matrix. `lv_calendar_get_btnmatrix(calendar)` can be used to get it. + - `LV_PART_MAIN` The background of the calendar. Uses all the background related style properties. + - `LV_PART_ITEMS` Refers to the dates and day names. Button matrix control flags are set to differentiate the buttons and a custom drawer event is added modify the properties of the buttons as follows: + - day names have no border, no background and drawn with a gray color + - days of the previous and next month have `LV_BTNMATRIX_CTRL_DISABLED` flag + - today has a thicker border with the theme's primary color + - highlighted days have some opacity with the theme's primary color. +- Header: Not created by default, the details are up to the given header. ## Usage @@ -53,8 +58,6 @@ Learn more about [Keys](/overview/indev). ## Headers -**From v8.1 the header is added directly into the Calendar widget and the API of the headers has been changed.** - ### Arrow buttons `lv_calendar_header_arrow_create(calendar)` creates a header that contains a left and right arrow on the sides and a text with the current year and month between them.