summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2024-06-25 00:42:33 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2024-06-25 00:51:45 +0200
commitc1cd8633a678623157a7d362ebb51a1416d3f98b (patch)
treea0e7a3be1cf41fb94761aa36152d8d67d2ead831
parent25ff1306d62b8eb0487608b2a9bed0644e2fce17 (diff)
downloadredot-engine-c1cd8633a678623157a7d362ebb51a1416d3f98b.tar.gz
Add default keyboard shortcuts to various actions in the FileSystem dock
Some of these shortcuts are inspired by Visual Studio Code's defaults. - Ctrl + Alt + C: Copy Absolute Path - Ctrl + Alt + Shift + C: Copy UID - Ctrl + Alt + R: Open in File Manager - Ctrl + Alt + E: Open in External Program - Ctrl + Alt + T: Open in Terminal - Note: On Linux distributions that have Ctrl + Alt + T as a default shortcut to open a terminal, the system shortcut takes priority over this one. The "Open Containing Folder in Terminal" text was shortened so that the context menu doesn't become too wide with the default shortcut annotations.
-rw-r--r--editor/filesystem_dock.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 44ff95b0f9..9d73d5902b 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -3285,7 +3285,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect
const bool is_directory = fpath.ends_with("/");
p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_OPEN_IN_TERMINAL);
- p_popup->set_item_text(p_popup->get_item_index(FILE_OPEN_IN_TERMINAL), is_directory ? TTR("Open in Terminal") : TTR("Open Containing Folder in Terminal"));
+ p_popup->set_item_text(p_popup->get_item_index(FILE_OPEN_IN_TERMINAL), is_directory ? TTR("Open in Terminal") : TTR("Open Folder in Terminal"));
if (!is_directory) {
p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("ExternalLink")), ED_GET_SHORTCUT("filesystem_dock/open_in_external_program"), FILE_OPEN_EXTERNAL);
@@ -3891,17 +3891,17 @@ FileSystemDock::FileSystemDock() {
// `KeyModifierMask::CMD_OR_CTRL | Key::C` conflicts with other editor shortcuts.
ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::C);
- ED_SHORTCUT("filesystem_dock/copy_absolute_path", TTR("Copy Absolute Path"));
- ED_SHORTCUT("filesystem_dock/copy_uid", TTR("Copy UID"));
+ ED_SHORTCUT("filesystem_dock/copy_absolute_path", TTR("Copy Absolute Path"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::C);
+ ED_SHORTCUT("filesystem_dock/copy_uid", TTR("Copy UID"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | KeyModifierMask::SHIFT | Key::C);
ED_SHORTCUT("filesystem_dock/duplicate", TTR("Duplicate..."), KeyModifierMask::CMD_OR_CTRL | Key::D);
ED_SHORTCUT("filesystem_dock/delete", TTR("Delete"), Key::KEY_DELETE);
ED_SHORTCUT("filesystem_dock/rename", TTR("Rename..."), Key::F2);
ED_SHORTCUT_OVERRIDE("filesystem_dock/rename", "macos", Key::ENTER);
#if !defined(ANDROID_ENABLED) && !defined(WEB_ENABLED)
// Opening the system file manager or opening in an external program is not supported on the Android and web editors.
- ED_SHORTCUT("filesystem_dock/show_in_explorer", TTR("Open in File Manager"));
- ED_SHORTCUT("filesystem_dock/open_in_external_program", TTR("Open in External Program"));
- ED_SHORTCUT("filesystem_dock/open_in_terminal", TTR("Open in Terminal"));
+ ED_SHORTCUT("filesystem_dock/show_in_explorer", TTR("Open in File Manager"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::R);
+ ED_SHORTCUT("filesystem_dock/open_in_external_program", TTR("Open in External Program"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::E);
+ ED_SHORTCUT("filesystem_dock/open_in_terminal", TTR("Open in Terminal"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::T);
#endif
// Properly translating color names would require a separate HashMap, so for simplicity they are provided as comments.