fix(btnmatrix): join active, pressed and focused button into active button

This commit is contained in:
Gabor Kiss-Vamosi
2021-02-24 05:10:48 +01:00
parent 326734545b
commit 8cf129b4af
10 changed files with 190 additions and 162 deletions

View File

@@ -6,7 +6,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
if(event == LV_EVENT_VALUE_CHANGED) {
lv_calendar_date_t date;
if(lv_calendar_get_pressed_date(obj, &date)) {
LV_LOG_USER("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
LV_LOG_USER("Clicked date: %02d.%02d.%d", date.day, date.month, date.year);
}
}
}
@@ -14,8 +14,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
void lv_example_calendar_1(void)
{
lv_obj_t * calendar = lv_calendar_create(lv_scr_act());
lv_obj_set_size(calendar, 180, 180);
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_size(calendar, 200, 200);
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 20);
lv_obj_add_event_cb(calendar, event_handler, NULL);
/*Set today's date*/
@@ -29,16 +29,16 @@ void lv_example_calendar_1(void)
/*Highlight a few days*/
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
highlighted_days[0].year = 2020;
highlighted_days[0].month = 10;
highlighted_days[0].year = 2021;
highlighted_days[0].month = 02;
highlighted_days[0].day = 6;
highlighted_days[1].year = 2020;
highlighted_days[1].month = 10;
highlighted_days[1].year = 2021;
highlighted_days[1].month = 02;
highlighted_days[1].day = 11;
highlighted_days[2].year = 2020;
highlighted_days[2].month = 11;
highlighted_days[2].year = 2022;
highlighted_days[2].month = 02;
highlighted_days[2].day = 22;
lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3);