From 0994d0a33e0669b1f0d7ec3c7f4ad4d1cf737691 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 15 May 2021 18:34:20 +0200 Subject: LibGUI: Delay setting column width in AutocompleteBox HeaderView doesn't allow you to set a column width until you've given it a model with some columns. --- Userland/Libraries/LibGUI/AutocompleteProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibGUI/AutocompleteProvider.cpp') diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index 990eefd06e..ba881d037a 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -88,7 +88,6 @@ AutocompleteBox::AutocompleteBox(TextEditor& editor) m_suggestion_view = m_popup_window->set_main_widget(); m_suggestion_view->set_column_headers_visible(false); - m_suggestion_view->set_column_width(1, 100); } void AutocompleteBox::update_suggestions(Vector&& suggestions) @@ -99,6 +98,7 @@ void AutocompleteBox::update_suggestions(Vector&& s model.set_suggestions(move(suggestions)); } else { m_suggestion_view->set_model(adopt_ref(*new AutocompleteSuggestionModel(move(suggestions)))); + m_suggestion_view->set_column_width(1, 100); m_suggestion_view->update(); if (has_suggestions) m_suggestion_view->set_cursor(m_suggestion_view->model()->index(0), GUI::AbstractView::SelectionUpdate::Set); -- cgit v1.2.3