16 lines
769 B
Rust
16 lines
769 B
Rust
//! Runtime chrome and persisted panel sizes affect shell geometry.
|
|
use egui::{Pos2, Rect};
|
|
use notescraft_ui_egui::layout::{CardVisibility, LayoutOptions, compute_rects_with_options};
|
|
#[test]
|
|
fn titlebar_inset_and_saved_widths_are_honoured() {
|
|
let screen = Rect::from_min_size(Pos2::ZERO, egui::vec2(1440.0, 900.0));
|
|
let visible = CardVisibility { sidebar: true, right: true };
|
|
for inset in [0.0, 40.0] {
|
|
let rects = compute_rects_with_options(screen, visible, LayoutOptions { sidebar_width: 280.0, right_width: 320.0, inset });
|
|
let sidebar = rects.sidebar.expect("sidebar");
|
|
assert_eq!(sidebar.top(), 8.0 + inset);
|
|
assert_eq!(sidebar.width(), 280.0);
|
|
assert_eq!(rects.right.expect("right").width(), 320.0);
|
|
}
|
|
}
|