Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Manager: Open project when "Enter" is pressed when the search box is focused #83210

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,14 @@ void ProjectManager::_on_search_term_changed(const String &p_term) {
_update_project_buttons();
}

void ProjectManager::_on_search_term_submitted(const String &p_text) {
if (tabs->get_current_tab() != 0) {
return;
}

_open_selected_projects_ask();
}

void ProjectManager::_bind_methods() {
ClassDB::bind_method("_update_project_buttons", &ProjectManager::_update_project_buttons);
ClassDB::bind_method("_version_button_pressed", &ProjectManager::_version_button_pressed);
Expand Down Expand Up @@ -2899,6 +2907,7 @@ ProjectManager::ProjectManager() {
search_box->set_tooltip_text(TTR("This field filters projects by name and last path component.\nTo filter projects by name and full path, the query must contain at least one `/` character."));
search_box->set_clear_button_enabled(true);
search_box->connect("text_changed", callable_mp(this, &ProjectManager::_on_search_term_changed));
search_box->connect("text_submitted", callable_mp(this, &ProjectManager::_on_search_term_submitted));
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hb->add_child(search_box);

Expand Down
1 change: 1 addition & 0 deletions editor/project_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ class ProjectManager : public Control {
void _on_order_option_changed(int p_idx);
void _on_tab_changed(int p_tab);
void _on_search_term_changed(const String &p_term);
void _on_search_term_submitted(const String &p_text);

static Ref<Texture2D> _file_dialog_get_icon(const String &p_path);
static Ref<Texture2D> _file_dialog_get_thumbnail(const String &p_path);
Expand Down