mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +00:00
LibGUI: ScrollableContainerWidget consider frame
Do not consider the space that is taken up by the frame, as useable size.
This commit is contained in:
parent
dab7ec190e
commit
a59e9a7a81
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue