Description
Hello,
I am using LVGL (8.4) to create a keypad thanks to the button matrix widget.
The application is running on an embedded system (STM32) with a 2.8" touchscreen. Display and touch are working fine.
I have noticed that, when I click on the screen to select a button, the whole screen refreshes. Since I use an embedded system with a “low-speed” SPI communication, refreshing is pretty visible.
Furthermore, I’ve also noticed is that when I drag from one button to another, only the button areas refresh (and not the whole screen!).
I activated the LV_USE_REFR_DEBUG
option in lv_conf.h
and it confirms what I am saying.
So, I have two questions:
- Is there any option to refresh only the button area when screen is touched?
- If not, would it be possible to disable the dark layer when a button is pressed so that the screen doesn’t need to be refreshed each time it is clicked?
What MCU/Processor/Board and compiler are you using?
STM32WB55 Board
What LVGL version are you using?
8.4
What do you want to achieve?
In a button matrix, refresh only the area of the button that has been pressed.
What have you tried so far?
- Changed background color when a button is pressed. The color changes but it’s not the one that I set (the darker layer is still there).
- Tried to figure out why the whole screen is refreshed when clicked but did not find any answer.
Code to reproduce
lv_obj_t *keypad = lv_btnmatrix_create(activeScreen);
lv_btnmatrix_set_map(keypad, keypadMap);
lv_obj_align(keypad, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_size(keypad, SCREEN_WIDTH, SCREEN_HEIGHT);
lv_btnmatrix_set_btn_ctrl_all(keypad, LV_BTNMATRIX_CTRL_NO_REPEAT);
lv_obj_add_event_cb(keypad, _lvgl_keypad_handler, LV_EVENT_VALUE_CHANGED, NULL);