Skip to content

Commit

Permalink
Make pressing Enter confirm project creation/import in the project ma…
Browse files Browse the repository at this point in the history
…nager

This makes the project manager more friendly to keyboard usage.

You can now create projects more easily without touching the mouse
by opening the project manager, pressing Ctrl + N, entering a project
name and pressing Enter.
  • Loading branch information
Calinou committed Sep 25, 2024
1 parent 0a9d8f0 commit 1bf8102
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/project_manager/project_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,12 @@ ProjectDialog::ProjectDialog() {
add_child(fdialog_install);

project_name->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_project_name_changed).unbind(1));
register_text_enter(project_name);
project_path->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_project_path_changed).unbind(1));
register_text_enter(project_path);
install_path->connect(SceneStringName(text_changed), callable_mp(this, &ProjectDialog::_install_path_changed).unbind(1));
register_text_enter(install_path);

fdialog_install->connect("dir_selected", callable_mp(this, &ProjectDialog::_install_path_selected));
fdialog_install->connect("file_selected", callable_mp(this, &ProjectDialog::_install_path_selected));

Expand Down
1 change: 1 addition & 0 deletions scene/scene_string_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,6 @@ SceneStringNames::SceneStringNames() {
confirmed = StaticCString::create("confirmed");

text_changed = StaticCString::create("text_changed");
text_submitted = StaticCString::create("text_submitted");
value_changed = StaticCString::create("value_changed");
}
1 change: 1 addition & 0 deletions scene/scene_string_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class SceneStringNames {
StringName confirmed;

StringName text_changed;
StringName text_submitted;
StringName value_changed;
};

Expand Down

0 comments on commit 1bf8102

Please sign in to comment.