From d7865d55a0ba72aea5664601b7148637d7be24a9 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 16:18:14 -0500 Subject: [PATCH] Move dragged tabs into a new split --- crates/ui-egui/src/panes.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panes.rs b/crates/ui-egui/src/panes.rs index 058f93e98f..fed9cf7a32 100644 --- a/crates/ui-egui/src/panes.rs +++ b/crates/ui-egui/src/panes.rs @@ -492,7 +492,15 @@ pub(crate) fn page_area(app: &mut PdfCraftApp, ui: &mut egui::Ui) { app.move_tab_to(index, place); } } - TabDropTarget::SplitEnd => app.split_tab(ui.ctx(), index, false), + TabDropTarget::SplitEnd => { + // The strip selects a tab as its drag starts. With other tabs in the pane, + // dropping it on a new split moves it rather than making a second view of it. + if app.place_of(index) == Some(Place::Main) && app.tabs_in(Place::Main).len() > 1 { + app.move_tab_to(index, Place::Second); + } else { + app.split_tab(ui.ctx(), index, false); + } + } _ => {} } }