From ce7f8548b723be20a69b02bc2b71c7fe3fa9241a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 18:41:35 +0100 Subject: [PATCH] Account for the themed minimum pane height in toolbar layout checks --- crates/ui-egui/tests/it/control.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/control.rs b/crates/ui-egui/tests/it/control.rs index ef3b326c5d..06fad08efa 100644 --- a/crates/ui-egui/tests/it/control.rs +++ b/crates/ui-egui/tests/it/control.rs @@ -1576,7 +1576,10 @@ fn a_horizontal_toolbar_fits_its_controls_above_or_below_the_page() { let pages = h.get_by_role_and_label(Role::Canvas, "Pages").rect(); let grip = h.get_by_role_and_label(Role::Button, "Toolbar").rect(); let gap = if edge == "Top" { pages.top() - rail.bottom() } else { grip.top() - pages.bottom() }; - assert!((-1.0..=12.0).contains(&gap), "{edge}, width {width}: {gap} blank points between the toolbar and the pages"); + let sizes = craft::ui::docking::DockSizes::of(&h.ctx); + // The dock also enforces its theme's minimum panel body and strip height. + let floor = (sizes.least_pane + sizes.strip - grip.height() - rail.height()).max(0.0); + assert!((-1.0..=floor + sizes.gap + 1.0).contains(&gap), "{edge}, width {width}: {gap} blank points between the toolbar and the pages"); assert!(rail.contains(h.get_by_role_and_label(Role::Button, "Edit toolbar").rect().center())); } }