Add light-mode Widget Gallery screenshot test (#7288)

Part of some work to improve text rendering in light mode (again!)
This commit is contained in:
Emil Ernerfeldt 2025-07-02 12:00:36 +02:00 committed by GitHub
parent 22c6a9ae69
commit 8bedaf6e5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 29 additions and 9 deletions

View File

@ -319,16 +319,27 @@ mod tests {
date: Some(chrono::NaiveDate::from_ymd_opt(2024, 1, 1).unwrap()),
..Default::default()
};
let mut harness = Harness::builder()
.with_pixels_per_point(2.0)
.with_size(Vec2::new(380.0, 550.0))
.build_ui(|ui| {
egui_extras::install_image_loaders(ui.ctx());
demo.ui(ui);
});
harness.fit_contents();
for pixels_per_point in [1, 2] {
for theme in [egui::Theme::Light, egui::Theme::Dark] {
let mut harness = Harness::builder()
.with_pixels_per_point(pixels_per_point as f32)
.with_theme(theme)
.with_size(Vec2::new(380.0, 550.0))
.build_ui(|ui| {
egui_extras::install_image_loaders(ui.ctx());
demo.ui(ui);
});
harness.snapshot("widget_gallery");
harness.fit_contents();
let theme_name = match theme {
egui::Theme::Light => "light",
egui::Theme::Dark => "dark",
};
let image_name = format!("widget_gallery_{theme_name}_x{pixels_per_point}");
harness.snapshot(&image_name);
}
}
}
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:62df72fd7e2404c4aa482f09eff5103ee28e8afc42ee8c8c74307a246f64cda6
size 64651

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2198a523fb986e90fa3a42f047499f5b1c791075e7c3822b45509d9880073966
size 60272

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bb371a477f58c90ac72aed45a081f3177ea968f090e3739bdb5044ade29f4be
size 144295