mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-27 04:37:07 +00:00
Merge branch 'pipe/s4' into area/app-1
This commit is contained in:
@@ -1701,11 +1701,11 @@ fn dragging_a_tab_moves_it_and_keeps_the_same_document_active() {
|
||||
let mut h = three_tab_harness();
|
||||
let ids: Vec<_> = h.state().views.iter().map(|view| view.id).collect();
|
||||
let tab = |h: &Harness<'static, PdfCraftApp>, name: &str| h.get_by_role_and_label(Role::Tab, name).rect();
|
||||
// first.pdf past the end; last.pdf, the active one, keeps the focus at its new place.
|
||||
// Pressing first.pdf selects it; dragging moves it without changing that selection.
|
||||
let to = tab(&h, "last.pdf").right_center() + egui::vec2(20.0, 0.0);
|
||||
drag_named_tab(&mut h, "first.pdf", to, true);
|
||||
assert_eq!(h.state().views.iter().map(|view| view.id).collect::<Vec<_>>(), [ids[1], ids[2], ids[0]]);
|
||||
assert_eq!(h.state().active_ids().map(|(_, id)| id), Some(ids[2]));
|
||||
assert_eq!(h.state().active_ids().map(|(_, id)| id), Some(ids[0]));
|
||||
assert!(tab(&h, "first.pdf").left() > tab(&h, "last.pdf").right(), "the strip draws the new order");
|
||||
// last.pdf, now in the middle, to the front.
|
||||
let to = tab(&h, "middle.pdf").left_center() - egui::vec2(10.0, 0.0);
|
||||
|
||||
Reference in New Issue
Block a user