mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-06 14:04:01 -05:00
Account for the themed minimum pane height in toolbar layout checks
This commit is contained in:
1 parent
3c5cde9c5c
commit
ce7f8548b7
1 file changed
+4
-1
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user