From 9156614de3ed45ec35838a46d6a99d476ed62d67 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 7 May 2022 13:07:53 +0200 Subject: LibGUI: Always use widget's minimum size in ScrollableContainerWidget I don't know if it makes much sense to use min_size and shrink_to_fit at the same time, but it will make the code a bit cleaner later. --- Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp index 761ae2332b..e22d91caa6 100644 --- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp +++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp @@ -44,13 +44,14 @@ void ScrollableContainerWidget::update_widget_size() new_size.set_width(preferred_size.width()); if (preferred_size.height() != -1) new_size.set_height(preferred_size.height()); - } else { - auto min_size = m_widget->min_size(); - new_size = Gfx::Size { - max(new_size.width(), min_size.width()), - max(new_size.height(), min_size.height()) - }; } + + auto min_size = m_widget->min_size(); + new_size = Gfx::Size { + max(new_size.width(), min_size.width()), + max(new_size.height(), min_size.height()), + }; + m_widget->resize(new_size); set_content_size(new_size); } -- cgit v1.2.3