Merge pull request #937 from nanox333/codex/fix-828-gpu-info-dialog
Keep GPU Information dialog layout steady # Conflicts: # crates/ui-egui/src/panels/dialogs.rs # crates/ui-egui/tests/ui_settings_info.rs
This commit is contained in:
@@ -134,3 +134,23 @@ fn gpu_information_names_the_adapter_and_why_the_gpu_is_off() {
|
||||
assert!(h.query_by_label_contains("Window graphics: NVIDIA GeForce RTX 4070").is_some(), "the window's adapter is shown");
|
||||
assert!(h.query_by_label_contains("GPU compositing is off: GPU compositor unavailable").is_some(), "the reason is shown");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gpu_information_dialog_stays_in_place() {
|
||||
let mut session = Session::default();
|
||||
session.prefs.appearance.ui_scale = 125;
|
||||
session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap();
|
||||
let mut h = Harness::builder().with_size(vec2(1280.0, 720.0)).build_eframe(|_| EffectcraftApp::new(session));
|
||||
h.run_steps(4);
|
||||
let ctx = h.ctx.clone();
|
||||
menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"previews"})).unwrap();
|
||||
h.run_steps(3);
|
||||
let button = rect(&h, "settings.button.GPU Information").center();
|
||||
click(&mut h, button);
|
||||
let start = h.get_by_label("GPU Information").rect();
|
||||
for _ in 0..20 {
|
||||
h.step();
|
||||
let current = h.get_by_label("GPU Information").rect();
|
||||
assert!((current.min - start.min).length() < 1.0, "GPU Information dialog moved");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user