From bb3429c1c5d9d5d332b800d4cfff5e77c645f578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Se=C5=86ko?= Date: Tue, 19 Feb 2019 00:03:54 +0200 Subject: [PATCH] Fix project opening while filter is applied. Fixes #25268 --- editor/project_manager.cpp | 7 +++++++ editor/project_manager.h | 1 + 2 files changed, 8 insertions(+) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 9efd0377721..bda5add381b 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1422,6 +1422,7 @@ void ProjectManager::_on_projects_updated() { } void ProjectManager::_on_project_created(const String &dir) { + project_filter->clear(); bool has_already = false; for (int i = 0; i < scroll_children->get_child_count(); i++) { HBoxContainer *hb = Object::cast_to(scroll_children->get_child(i)); @@ -2235,3 +2236,9 @@ ProjectListFilter::ProjectListFilter() { has_search_box = false; } + +void ProjectListFilter::clear() { + if (has_search_box) { + search_box->clear(); + } +} diff --git a/editor/project_manager.h b/editor/project_manager.h index 6eb55871e4f..1fdd7dbe063 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -154,6 +154,7 @@ public: FilterOption get_filter_option(); void set_filter_option(FilterOption); ProjectListFilter(); + void clear(); }; #endif // PROJECT_MANAGER_H