From 94c6d25f1827a9d21e136b3c25b388c853fdfbd4 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 7 May 2022 15:19:36 +0200 Subject: [PATCH] window: fixed adjustHeight() & moveWindowsTop() --- radio/src/thirdparty/libopenui/src/window.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/window.cpp b/radio/src/thirdparty/libopenui/src/window.cpp index 1567a77f9..f87ceda2d 100644 --- a/radio/src/thirdparty/libopenui/src/window.cpp +++ b/radio/src/thirdparty/libopenui/src/window.cpp @@ -621,8 +621,12 @@ void Window::adjustInnerHeight() coord_t Window::adjustHeight() { coord_t old = rect.h; - adjustInnerHeight(); - if (lvobj) lv_obj_set_style_height(lvobj, rect.h, LV_PART_MAIN); + if (lvobj) { + 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; } @@ -634,7 +638,7 @@ void Window::moveWindowsTop(coord_t y, coord_t delta) for (auto child: children) { if (child->rect.y >= y) { - child->rect.y += delta; + child->setTop(child->top() + delta); invalidate(); } }