Increase the header part of calendar


I wanted to draw the header of calendar in blue color as it was in v6. But after adding these lines:

lv_obj_set_style_local_bg_color(calendar_date, LV_CALENDAR_PART_HEADER, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x01, 0xA2, 0xB1));
lv_obj_set_style_local_bg_opa(calendar_date, LV_CALENDAR_PART_HEADER, LV_STATE_DEFAULT, LV_OPA_COVER);

See that its height is so small.
As far as I understood, its height is equal to the its font height. so I want to know if there is any way to increase it or not?

What MCU/Processor/Board and compiler are you using?

STM32f429, CubeIDE

What LVGL version are you using?


What do you want to achieve?

Increase the height of the header in a calendar object.

What have you tried so far?

I’m not sure if this is a good idea. But I think we should be able to increase this height by setting the padding of LV_CALENDAR_PART_HEADER. I mean something like this:

lv_obj_set_style_local_pad_ver(calendar_date, LV_CALENDAR_PART_HEADER, LV_STATE_DEFAULT, 20);

Maybe some part of the code in lv_calendar.c instead of padding should use margin. what do you think?

From the code, it looks like you can already increase the space between the top of the calendar and the header by using top padding on LV_CALENDAR_PART_HEADER. I don’t know if that gives you the effect you want.

Yeah, but I think it’s better to increase this space by setting the margin on LV_CALENDAR_PART_HEADER and increasing its height by setting the padding on LV_CALENDAR_PART_HEADER.

PR #1817 was sent with respect to this problem.

1 Like