File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -5828,7 +5828,11 @@ PopupMenu *EditorNode::get_export_as_menu() {
58285828}
58295829
58305830void EditorNode::_dropped_files (const Vector<String> &p_files) {
5831- String to_path = ProjectSettings::get_singleton ()->globalize_path (FileSystemDock::get_singleton ()->get_current_directory ());
5831+ String to_path = FileSystemDock::get_singleton ()->get_folder_path_at_mouse_position ();
5832+ if (to_path.is_empty ()) {
5833+ to_path = FileSystemDock::get_singleton ()->get_current_directory ();
5834+ }
5835+ to_path = ProjectSettings::get_singleton ()->globalize_path (to_path);
58325836
58335837 _add_dropped_files_recursive (p_files, to_path);
58345838
Original file line number Diff line number Diff line change @@ -2749,6 +2749,15 @@ void FileSystemDock::remove_resource_tooltip_plugin(const Ref<EditorResourceTool
27492749 tooltip_plugins.remove_at (index);
27502750}
27512751
2752+ String FileSystemDock::get_folder_path_at_mouse_position () const {
2753+ TreeItem *item = tree->get_item_at_position (tree->get_local_mouse_position ());
2754+ if (!item) {
2755+ return String ();
2756+ }
2757+ String fpath = item->get_metadata (0 );
2758+ return fpath.get_base_dir ();
2759+ }
2760+
27522761Control *FileSystemDock::create_tooltip_for_path (const String &p_path) const {
27532762 if (p_path == " Favorites" ) {
27542763 // No tooltip for the "Favorites" group.
Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ class FileSystemDock : public VBoxContainer {
380380
381381 String get_current_path () const ;
382382 String get_current_directory () const ;
383+ String get_folder_path_at_mouse_position () const ;
383384
384385 void navigate_to_path (const String &p_path);
385386 void focus_on_path ();
You can’t perform that action at this time.
0 commit comments