From 88849ea766da27f6283dd755632602966e84c5aa Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Wed, 15 Jun 2022 19:16:04 +0300 Subject: [PATCH] Improve main widget resize behavior in Window --- src/Window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Window.cpp b/src/Window.cpp index 0518a0d..00896e7 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -154,6 +154,10 @@ void Window::run(bool block) { m_rect.set_height(e.xconfigure.height); // if we have a main widget, we are going to have to resize it as well if (m_main_widget) { + m_main_widget->rect().set_max_height(m_rect.height()); + m_main_widget->rect().set_max_width(m_rect.width()); + m_main_widget->rect().set_min_height(m_rect.height()); + m_main_widget->rect().set_min_width(m_rect.width()); m_main_widget->rect().set_width(m_rect.width()); m_main_widget->rect().set_height(m_rect.height()); }