summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/AutocompleteProvider.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-15 18:34:20 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-15 18:35:06 +0200
commit0994d0a33e0669b1f0d7ec3c7f4ad4d1cf737691 (patch)
tree62d493a181a9ba0cc2cdde74b4ba6e510f2dbfb7 /Userland/Libraries/LibGUI/AutocompleteProvider.cpp
parentae7c5411a6b4c4360c229e44c9b1e88e5d9cacbe (diff)
downloadserenity-0994d0a33e0669b1f0d7ec3c7f4ad4d1cf737691.zip
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.
Diffstat (limited to 'Userland/Libraries/LibGUI/AutocompleteProvider.cpp')
-rw-r--r--Userland/Libraries/LibGUI/AutocompleteProvider.cpp2
1 files changed, 1 insertions, 1 deletions
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<GUI::TableView>();
m_suggestion_view->set_column_headers_visible(false);
- m_suggestion_view->set_column_width(1, 100);
}
void AutocompleteBox::update_suggestions(Vector<AutocompleteProvider::Entry>&& suggestions)
@@ -99,6 +98,7 @@ void AutocompleteBox::update_suggestions(Vector<AutocompleteProvider::Entry>&& 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);