diff options
author | FrHun <28605587+frhun@users.noreply.github.com> | 2021-09-28 16:25:12 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-03 16:13:19 +0100 |
commit | a59e9a7a810cc53b58c22e576a0c5cdf8b7e682b (patch) | |
tree | 3ca0cedc89189e9893905fc90b63f57692e3f8a6 | |
parent | dab7ec190e55a6d0a3e9e2ceb695e4534d2f4011 (diff) | |
download | serenity-a59e9a7a810cc53b58c22e576a0c5cdf8b7e682b.zip |
LibGUI: ScrollableContainerWidget consider frame
Do not consider the space that is taken up by the frame, as useable
size.
-rw-r--r-- | Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp index 4a348195a5..0bb25d7b46 100644 --- a/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp +++ b/Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp @@ -27,7 +27,7 @@ void ScrollableContainerWidget::update_widget_position() { if (!m_widget) return; - m_widget->move_to(-horizontal_scrollbar().value(), -vertical_scrollbar().value()); + m_widget->move_to(-horizontal_scrollbar().value() + content_margins().left(), -vertical_scrollbar().value() + content_margins().top()); } void ScrollableContainerWidget::update_widget_size() @@ -36,7 +36,7 @@ void ScrollableContainerWidget::update_widget_size() return; m_widget->do_layout(); if (m_widget->is_shrink_to_fit() && m_widget->layout()) { - auto new_size = frame_inner_rect().size(); + auto new_size = Widget::content_size(); auto preferred_size = m_widget->layout()->preferred_size(); if (preferred_size.width() != -1) new_size.set_width(preferred_size.width()); |