diff options
author | Invertex <Invertex@users.noreply.github.com> | 2023-11-14 03:55:36 -0800 |
---|---|---|
committer | Invertex <Invertex@users.noreply.github.com> | 2023-12-13 07:43:39 -0800 |
commit | 59787683a91c25d28e69b67ae9a56eac6f6d83bd (patch) | |
tree | b040ac03e1dcf07be4338f602306533fe12ff88b /editor/filesystem_dock.cpp | |
parent | c455cb65550c19afbbf657a1dbf9af2ca3b603da (diff) | |
download | redot-engine-59787683a91c25d28e69b67ae9a56eac6f6d83bd.tar.gz |
Added "Show In FileSystem" right-click option to Scene hierarchy nodes.
-Implemented shared function for focusing FileSystem tab and highlighting the node path.
-Created right-click option that shows up in the Scene-Hierarchy on Nodes that have a file-system source path.
-Created custom icon for this right-click option
-Implemented the shared function and icon for other places that already had this features (Open Node tab, Inspector Resource)
Co-authored-by: MewPurPur <mew.pur.pur@gmail.com>
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 944da47242..2705033507 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -756,6 +756,14 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa void FileSystemDock::navigate_to_path(const String &p_path) { file_list_search_box->clear(); _navigate_to_path(p_path); + + // Ensure that the FileSystem dock is visible. + if (get_window() == get_tree()->get_root()) { + TabContainer *tab_container = (TabContainer *)get_parent_control(); + tab_container->set_current_tab(tab_container->get_tab_idx_from_control((Control *)this)); + } else { + get_window()->grab_focus(); + } } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) { |