summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-26 15:21:26 +0200
committerGitHub <noreply@github.com>2019-05-26 15:21:26 +0200
commit7cd3e91acfcd4008a49e1795215989ed8d64f7bc (patch)
tree5f50fd05116ab8c155fb1e1a43bcf9faa6b05db1 /editor
parent0d8f1ba6a9182d1f1af39097e2165fc9807377f5 (diff)
parentdeb7152724a8a388dcbf2f546eb44634863d27ef (diff)
Merge pull request #27252 from Calinou/add-shortcut-quit-project-manager
Quit the Project Manager when Command + Q is pressed
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 6de4330493..81c99eafd3 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2166,6 +2166,19 @@ ProjectManager::ProjectManager() {
Button *cancel = memnew(Button);
cancel->set_text(TTR("Exit"));
cancel->set_custom_minimum_size(Size2(100, 1) * EDSCALE);
+
+#ifndef OSX_ENABLED
+ // Pressing Command + Q quits the Project Manager
+ // This is handled by the platform implementation on macOS,
+ // so only define the shortcut on other platforms
+ InputEventKey *quit_key = memnew(InputEventKey);
+ quit_key->set_command(true);
+ quit_key->set_scancode(KEY_Q);
+ ShortCut *quit_shortcut = memnew(ShortCut);
+ quit_shortcut->set_shortcut(quit_key);
+ cancel->set_shortcut(quit_shortcut);
+#endif
+
cc->add_child(cancel);
cancel->connect("pressed", this, "_exit_dialog");
vb->add_child(cc);