minor fixes
This commit is contained in:
@@ -18,14 +18,8 @@ void lv_example_calendar_1(void)
|
||||
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 20);
|
||||
lv_obj_add_event_cb(calendar, event_handler, NULL);
|
||||
|
||||
/*Set today's date*/
|
||||
lv_calendar_date_t today;
|
||||
today.year = 2021;
|
||||
today.month = 02;
|
||||
today.day = 23;
|
||||
|
||||
lv_calendar_set_today_date(calendar, &today);
|
||||
lv_calendar_set_showed_date(calendar, &today);
|
||||
lv_calendar_set_today_date(calendar, 2021, 02, 23);
|
||||
lv_calendar_set_showed_date(calendar, 2021, 02);
|
||||
|
||||
/*Highlight a few days*/
|
||||
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
|
||||
@@ -43,10 +37,11 @@ void lv_example_calendar_1(void)
|
||||
|
||||
lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3);
|
||||
|
||||
#if LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_obj_t * h = lv_calendar_header_arrow_create(lv_scr_act(), calendar, 25);
|
||||
lv_obj_align(h, NULL, LV_ALIGN_IN_TOP_MID, 0, 5);
|
||||
lv_obj_align(calendar, h, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
|
||||
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, -20);
|
||||
#if LV_USE_CALENDAR_HEADER_DROPDOWN
|
||||
lv_calendar_header_dropdown_create(lv_scr_act(), calendar);
|
||||
#elif LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_calendar_header_arrow_create(lv_scr_act(), calendar, 25);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void lv_example_textarea_2(void)
|
||||
/* Create the password box */
|
||||
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_textarea_set_text(pwd_ta, "");
|
||||
lv_textarea_set_pwd_mode(pwd_ta, true);
|
||||
lv_textarea_set_password_mode(pwd_ta, true);
|
||||
lv_textarea_set_one_line(pwd_ta, true);
|
||||
lv_obj_set_width(pwd_ta, LV_HOR_RES / 2 - 20);
|
||||
lv_obj_set_pos(pwd_ta, 5, 20);
|
||||
@@ -23,7 +23,7 @@ void lv_example_textarea_2(void)
|
||||
|
||||
/* Create the one-line mode text area */
|
||||
lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
|
||||
lv_textarea_set_pwd_mode(oneline_ta, false);
|
||||
lv_textarea_set_password_mode(oneline_ta, false);
|
||||
lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user