diff --git a/README.md b/README.md index 5286e84..f7e53e0 100644 --- a/README.md +++ b/README.md @@ -292,12 +292,10 @@ - Best for "popup over app" with no lag - [ ] Drag and drop files into breadcrumb folders - [ ] Support network devices +- [ ] Drag and drop files from EdenExplorer into Windows objects (Desktop, File Explorer, applications, etc.) ## 🐛 Known Bugs -- After hitting "Enter" when renaming a new file/folder, it should automatically select that item in the itemviewer -- Dragging and dropping files into empty folders/directories doesn't do anything - Hitting "Shift" after already shift-selecting files drops the entire file selection -- Entering "%appdata%" in the breadcrumbs/path throws an invalid path errors ## Star History diff --git a/src/gui/windows/containers/itemviewer.rs b/src/gui/windows/containers/itemviewer.rs index 8454f0b..fb9eaa4 100644 --- a/src/gui/windows/containers/itemviewer.rs +++ b/src/gui/windows/containers/itemviewer.rs @@ -53,6 +53,21 @@ pub fn draw_item_viewer( let mut any_row_hovered = false; if files.is_empty() { + // Handle drag and drop for empty folders + if ui.ctx().input(|i| !i.raw.dropped_files.is_empty()) { + let dropped_paths: Vec = ui.ctx().input(|i| { + i.raw + .dropped_files + .iter() + .filter_map(|f| f.path.clone()) + .collect() + }); + + if !dropped_paths.is_empty() { + action = Some(ItemViewerAction::FilesDropped(dropped_paths)); + } + } + ui.centered_and_justified(|ui| { if is_loading { ui.add(egui::Spinner::new().size(28.0)); @@ -147,7 +162,7 @@ pub fn draw_item_viewer( .resizable(true) .id_salt("item_viewer_table"); - // If we have a newly created row, scroll to it + // If we have a newly created row, scroll to it and select it if let Some(new_path) = &explorer_state.newly_created_path { if let Some(idx) = filter_state .cached_indices @@ -155,6 +170,13 @@ pub fn draw_item_viewer( .position(|&i| files[i].path == *new_path) { table = table.scroll_to_row(idx, Some(egui::Align::Center)); + + // Auto-select the newly created/renamed item + explorer_state.selected_paths.clear(); + explorer_state.selected_paths.insert(new_path.clone()); + explorer_state.selection_anchor = Some(idx); + explorer_state.selection_focus = Some(idx); + explorer_state.newly_created_path = None; } } diff --git a/src/gui/windows/mainwindow_imp.rs b/src/gui/windows/mainwindow_imp.rs index c319f8e..e9a50fc 100644 --- a/src/gui/windows/mainwindow_imp.rs +++ b/src/gui/windows/mainwindow_imp.rs @@ -347,6 +347,9 @@ impl MainWindow { file_op.PerformOperations().ok(); } + + // Set the renamed file path for auto-selection and scrolling + self.explorer_state.newly_created_path = Some(target); } }