window: fixed adjustHeight() & moveWindowsTop()

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent 904eb62029
commit 94c6d25f18
+7 -3
View File
@@ -621,8 +621,12 @@ void Window::adjustInnerHeight()
coord_t Window::adjustHeight() coord_t Window::adjustHeight()
{ {
coord_t old = rect.h; coord_t old = rect.h;
adjustInnerHeight(); if (lvobj) {
if (lvobj) lv_obj_set_style_height(lvobj, rect.h, LV_PART_MAIN); lv_obj_set_height(lvobj, LV_SIZE_CONTENT);
lv_obj_update_layout(lvobj);
rect.h = lv_obj_get_height(lvobj);
lv_obj_set_style_height(lvobj, rect.h, LV_PART_MAIN);
}
return rect.h - old; return rect.h - old;
} }
@@ -634,7 +638,7 @@ void Window::moveWindowsTop(coord_t y, coord_t delta)
for (auto child: children) { for (auto child: children) {
if (child->rect.y >= y) { if (child->rect.y >= y) {
child->rect.y += delta; child->setTop(child->top() + delta);
invalidate(); invalidate();
} }
} }