Compare commits

...
Author SHA1 Message Date
Martin BallandClaude Opus 5.5 8803a95a2d #7171: Print settings buttons stay clear of the scroll bar and the preview
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 02:18:15 +00:00
+18
View File
@@ -939,3 +939,21 @@ fn clicking_beside_the_back_arrow_does_not_close_the_file_page() {
h.run_steps(4);
assert!(h.state().ui.backstage, "clicking beside the arrow leaves the File page open");
}
/// #7171: in a window too short for the settings column its scroll bar shows, and the buttons stop where the bar's lane
/// starts instead of running under it. The column also ends short of the preview.
#[test]
fn print_settings_buttons_stay_clear_of_the_bar_and_the_preview() {
let mut a = new_app();
a.run("text.insert", json!({"text": "Some text"})).unwrap();
a.run("ui.backstage", json!({"value": true, "page": "print"})).unwrap();
let mut h = harness(a, egui::vec2(700.0, 500.0));
h.run_steps(8);
let column = h.query_all_by_label("Print").map(|n| n.rect()).max_by(|a, b| a.height().total_cmp(&b.height())).expect("the settings column");
let pane = h.query_all_by_label("Sheet 1 of 1").map(|n| n.rect()).max_by(|a, b| a.height().total_cmp(&b.height())).expect("the preview");
assert!(pane.min.x >= column.max.x + 8.0, "a gap between the column and the preview: {column:?} {pane:?}");
for name in ["Save these pages as PDF…", "PDF document (*.pdf)"] {
let button = h.get_by_label(name).rect();
assert!(button.min.x >= column.min.x && button.max.x <= column.max.x - 4.0, "{name} leaves the bar's lane: {button:?} {column:?}");
}
}