mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-23 07:34:14 -04:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12ca4cc65b |
@@ -1395,6 +1395,23 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
// Regression test for #49: the in-window menu headings (File, Edit, ...) sat only egui's default
|
||||
// 8 px apart, too close to read or aim at.
|
||||
#[test]
|
||||
fn in_window_menu_headings_are_spaced_apart() {
|
||||
let mut a = app();
|
||||
a.native_menu = false;
|
||||
let mut h = crate::headless::Headless::new(a, [1400.0, 900.0], 1.0);
|
||||
h.step();
|
||||
h.step();
|
||||
let rect = |id: &str| h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r).unwrap_or_else(|| panic!("{id} is on screen"));
|
||||
let titles: Vec<_> = ["File", "Edit", "View", "Photo", "Window", "Help"].iter().map(|t| rect(&format!("menu:{t}"))).collect();
|
||||
for pair in titles.windows(2) {
|
||||
let gap = pair[1].left() - pair[0].right();
|
||||
assert!(gap >= 24.0 - 0.5, "headings {:?} and {:?} are only {gap} px apart", pair[0], pair[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/// A backup the host refuses (changes still unsaved, issue #1508) says why when started from
|
||||
/// the menu, as a refused export does; the refusal used to reach only the control channel.
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user