1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:47:35 +00:00

LibGUI: Use preferred_size to emulate old is_shrink_to_fit

This commit is contained in:
FrHun 2022-06-12 22:18:52 +02:00 committed by Sam Atkins
parent bd277939a1
commit 2600669b73
2 changed files with 6 additions and 7 deletions

View file

@ -1193,12 +1193,11 @@ bool Widget::has_focus_within() const
return window->focused_widget() == &effective_focus_widget || is_ancestor_of(*window->focused_widget());
}
void Widget::set_shrink_to_fit(bool b)
void Widget::set_shrink_to_fit(bool shrink_to_fit)
{
if (m_shrink_to_fit == b)
return;
m_shrink_to_fit = b;
invalidate_layout();
// This function is deprecated, and soon to be removed, it is only still here to ease the transition to UIDimensions
if (shrink_to_fit)
set_preferred_size(SpecialDimension::Fit);
}
bool Widget::has_pending_drop() const