mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:58:13 +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:
parent
3e4f912479
commit
9156614de3
1 changed files with 7 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue