summaryrefslogtreecommitdiffstats
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-05 09:55:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-05 09:55:36 +0100
commit9e13b90ce86a0942415e6ecaa6db9d058a673472 (patch)
tree99562af9f5acf3cac79be15ed9043bfcac59cf2b /editor/filesystem_dock.cpp
parent897e2d9a40713afdd0d0f25a10aa7f6229f6421a (diff)
parent4f8d7cae2601343d6221ec95485fc6812c9a22d8 (diff)
downloadredot-engine-9e13b90ce86a0942415e6ecaa6db9d058a673472.tar.gz
Merge pull request #81177 from Calinou/filedialog-focus-path-shortcut
Add Ctrl + L / Cmd + Shift + G shortcut to focus path bar in FileDialog
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index a7e40ce5b9..88fed16db1 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -2575,6 +2575,11 @@ void FileSystemDock::fix_dependencies(const String &p_for_file) {
deps_editor->edit(p_for_file);
}
+void FileSystemDock::focus_on_path() {
+ current_path_line_edit->grab_focus();
+ current_path_line_edit->select_all();
+}
+
void FileSystemDock::focus_on_filter() {
LineEdit *current_search_box = nullptr;
if (display_mode == DISPLAY_MODE_TREE_ONLY) {
@@ -3398,6 +3403,8 @@ void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) {
_tree_rmb_option(FILE_OPEN_EXTERNAL);
} else if (ED_IS_SHORTCUT("filesystem_dock/open_in_terminal", p_event)) {
_tree_rmb_option(FILE_OPEN_IN_TERMINAL);
+ } else if (ED_IS_SHORTCUT("file_dialog/focus_path", p_event)) {
+ focus_on_path();
} else if (ED_IS_SHORTCUT("editor/open_search", p_event)) {
focus_on_filter();
} else {