mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(obj) fix size invalidation issue on padding change
If a style properties with LV_STYLE_PROP_LAYOUT_REFR is applied on a not MAIN part it might effect the size if the size is LV_SIZE_CONTENT. So check it in lv_obj_refresh_style()
This commit is contained in:
parent
1c3ecf1cc1
commit
33ba7225f5
@ -175,9 +175,15 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
|
||||
|
||||
lv_part_t part = lv_obj_style_get_selector_part(selector);
|
||||
|
||||
if((part == LV_PART_ANY || part == LV_PART_MAIN) && (prop == LV_STYLE_PROP_ANY || (prop & LV_STYLE_PROP_LAYOUT_REFR))) {
|
||||
lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL);
|
||||
lv_obj_mark_layout_as_dirty(obj);
|
||||
if(prop & LV_STYLE_PROP_LAYOUT_REFR) {
|
||||
if(part == LV_PART_ANY ||
|
||||
part == LV_PART_MAIN ||
|
||||
lv_obj_get_style_height(obj, 0) == LV_SIZE_CONTENT ||
|
||||
lv_obj_get_style_width(obj, 0) == LV_SIZE_CONTENT)
|
||||
{
|
||||
lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL);
|
||||
lv_obj_mark_layout_as_dirty(obj);
|
||||
}
|
||||
}
|
||||
if((part == LV_PART_ANY || part == LV_PART_MAIN) && (prop == LV_STYLE_PROP_ANY || (prop & LV_STYLE_PROP_PARENT_LAYOUT_REFR))) {
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
|
Loading…
x
Reference in New Issue
Block a user