1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibGUI: Remove calculated_min_size() for ListViews

Originally implemented to handle resizable ComboBox windows, this
"feature" no longer exists, so calculating min size is no longer
necessary. The calculation was also failing to account for dynamic
ListViews properly.

This patch simplifies things by setting ComboBox ListView's minimum size
explicitly and deferring to AbstractScrollableWidget's more flexible
calculated implementation otherwise.

Fixes FontPicker resizing incorrectly due to overly rigid ListViews.
This commit is contained in:
thankyouverycool 2023-04-02 13:26:02 -04:00 committed by Andreas Kling
parent bd46397e1f
commit 99f28cf4ac
3 changed files with 1 additions and 15 deletions

View file

@ -257,6 +257,7 @@ void ComboBox::open()
}
rect.intersect(desktop);
m_list_window->set_rect(rect);
m_list_view->set_min_size(rect.size());
if (m_selected_index.has_value())
m_list_view->set_cursor(m_selected_index.value(), AbstractView::SelectionUpdate::Set);