feat(dropdown): keep the list on open/close for simpler styling
So far it was deleted on close, now it's just hidden/unhidden
This commit is contained in:
@@ -29,8 +29,8 @@ The button goes to `LV_STATE_CHECKED` when it's opened.
|
||||
- `LV_PART_SCROLLBAR` The scrollbar background, border, shadow properties and width (for its own width) and right padding for the spacing on the right.
|
||||
- `LV_PART_SELECTED` Refers to the currently pressed, checked or pressed+checked option. Also uses the typical background properties.
|
||||
|
||||
As list does not exist when the drop-down list is closed it's not possible to simply add styles to it.
|
||||
Instead, add an event handler to the button for `LV_EVENT_READY` (triggered when the list is opened) and add styles to the list in it like this:
|
||||
The list is hidden/shown on open/close. To add styles to it use `lv_dropdown_get_list(dropdown)` to get the list object. For example:
|
||||
|
||||
```c
|
||||
lv_obj_t * list = lv_dropdown_get_list(dropdown) /*Get the list*/
|
||||
lv_obj_add_style(list, &my_style, ...) /*Add the styles to the list*/}`
|
||||
|
||||
Reference in New Issue
Block a user