mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
3e4f912479
commit
9156614de3
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user