From e13bcf5b845fba1dbb2bbb02c8f14e7d3733a188 Mon Sep 17 00:00:00 2001 From: yedpodtrzitko Date: Fri, 10 Mar 2023 18:10:05 +0800 Subject: [PATCH] clear filter input in Project Settings when opening Layers --- editor/editor_properties.cpp | 2 +- editor/plugins/asset_library_editor_plugin.cpp | 2 +- editor/project_settings_editor.cpp | 6 +++++- editor/project_settings_editor.h | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 801f1ca5b6f..b8e491b243b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -1210,7 +1210,7 @@ void EditorPropertyLayers::_button_pressed() { void EditorPropertyLayers::_menu_pressed(int p_menu) { if (p_menu == grid->layer_count) { - ProjectSettingsEditor::get_singleton()->popup_project_settings(); + ProjectSettingsEditor::get_singleton()->popup_project_settings(true); ProjectSettingsEditor::get_singleton()->set_general_page(basename); } else { if (grid->value & (1 << p_menu)) { diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 26397652837..151d46b6738 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1398,7 +1398,7 @@ void EditorAssetLibrary::_asset_open() { } void EditorAssetLibrary::_manage_plugins() { - ProjectSettingsEditor::get_singleton()->popup_project_settings(); + ProjectSettingsEditor::get_singleton()->popup_project_settings(true); ProjectSettingsEditor::get_singleton()->set_plugins_page(); } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 374ce98d636..c8fbd76f69c 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -45,7 +45,7 @@ void ProjectSettingsEditor::connect_filesystem_dock_signals(FileSystemDock *p_fs localization_editor->connect_filesystem_dock_signals(p_fs_dock); } -void ProjectSettingsEditor::popup_project_settings() { +void ProjectSettingsEditor::popup_project_settings(bool p_clear_filter) { // Restore valid window bounds or pop up at default size. Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "project_settings", Rect2()); if (saved_size != Rect2()) { @@ -62,6 +62,10 @@ void ProjectSettingsEditor::popup_project_settings() { autoload_settings->update_autoload(); plugin_settings->update_plugins(); import_defaults_editor->clear(); + + if (p_clear_filter) { + search_box->clear(); + } } void ProjectSettingsEditor::queue_save() { diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index 31f644da740..eaac7e8c5a1 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -116,7 +116,7 @@ protected: public: static ProjectSettingsEditor *get_singleton() { return singleton; } - void popup_project_settings(); + void popup_project_settings(bool p_clear_filter = false); void set_plugins_page(); void set_general_page(const String &p_category); void update_plugins();