From 61299dc45113a0d2be1ee1daae212a27d6b6fc10 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 23 Sep 2019 02:50:50 +0200 Subject: [PATCH] Focus the project manager's search box automatically on startup This allows the user to search projects as soon as the project manager opens, without having to click on the search field first. --- editor/project_manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 701676a7f80..e2527a4039d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1757,6 +1757,12 @@ void ProjectManager::_notification(int p_what) { if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) open_templates->popup_centered_minsize(); + + if (_project_list->get_project_count() >= 1) { + // Focus on the search box immediately to allow the user + // to search without having to reach for their mouse + project_filter->search_box->grab_focus(); + } } break; case NOTIFICATION_VISIBILITY_CHANGED: {