fix(obj style) fix children reposition if the parent's padding changes.

fixes #2368
This commit is contained in:
Gabor Kiss-Vamosi
2021-07-15 20:42:04 +02:00
parent 7f7b9670d9
commit 7bd924bd4d

View File

@@ -634,6 +634,13 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
else if(code == LV_EVENT_PRESS_LOST) {
lv_obj_clear_state(obj, LV_STATE_PRESSED);
}
else if(code == LV_EVENT_STYLE_CHANGED) {
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
for(uint32_t i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
lv_obj_mark_layout_as_dirty(child);
}
}
else if(code == LV_EVENT_KEY) {
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) {
char c = *((char *)lv_event_get_param(e));