mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 19:41:36 -05:00
Merge commit '310a96859' into fix/vectorcraft-0251-interface-clarity
This commit is contained in:
@@ -1074,14 +1074,18 @@ mod tests {
|
||||
|
||||
/// [`laid_out`] in a window of `size`.
|
||||
fn laid_out_in(app: &mut VectorcraftApp, size: egui::Vec2) -> egui::FullOutput {
|
||||
laid_out_after(app, size, 3)
|
||||
}
|
||||
|
||||
fn laid_out_after(app: &mut VectorcraftApp, size: egui::Vec2, last_frame: u32) -> egui::FullOutput {
|
||||
let ctx = ctx(app);
|
||||
let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, size);
|
||||
let mut frame = |i: u32| {
|
||||
let input = egui::RawInput { time: Some(0.1 * f64::from(i)), screen_rect: Some(screen), ..Default::default() };
|
||||
crate::testing::part_frame(app, &ctx, input, |app, ui| app.ui(ui))
|
||||
};
|
||||
(0..3).for_each(|i| drop(frame(i)));
|
||||
frame(3)
|
||||
(0..last_frame).for_each(|i| drop(frame(i)));
|
||||
frame(last_frame)
|
||||
}
|
||||
|
||||
/// Orientation shows a page icon for Portrait and for Landscape, named for screen readers, as production's buttons
|
||||
@@ -1125,12 +1129,17 @@ mod tests {
|
||||
theme.textures_delta.clear();
|
||||
let mut app = app();
|
||||
open(&mut app);
|
||||
let out = laid_out(&mut app);
|
||||
// The resting appearance is measured after dialog and tile state transitions have settled.
|
||||
let out = laid_out_after(&mut app, egui::vec2(1280.0, 900.0), 15);
|
||||
let nodes = out.platform_output.accesskit_update.as_ref().map(|u| u.nodes.clone()).unwrap_or_default();
|
||||
// Print opens on Letter. Inspect the A4 preset, away from the initial focus and the selected preset.
|
||||
let card = nodes
|
||||
.iter()
|
||||
.find(|(_, n)| n.role() == egui::accesskit::Role::ListItem && n.label() == Some("A4") && n.is_selected() == Some(false))
|
||||
.find(|(_, n)| {
|
||||
n.role() == egui::accesskit::Role::ListItem
|
||||
&& n.label().is_some_and(|name| name.split(',').next() == Some("A4"))
|
||||
&& n.is_selected() == Some(false)
|
||||
})
|
||||
.and_then(|(_, n)| n.bounds())
|
||||
.map(|b| egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32)))
|
||||
.unwrap_or_else(|| {
|
||||
|
||||
Reference in New Issue
Block a user