1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

egui_kittest: Add HarnessBuilder::theme (#7289)

Makes it ergonomic to snapshot test light vs dark mode
This commit is contained in:
Emil Ernerfeldt
2025-07-02 12:00:22 +02:00
committed by GitHub
parent 0857527f1d
commit 22c6a9ae69
2 changed files with 11 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ impl<'a, State> Harness<'a, State> {
let HarnessBuilder {
screen_rect,
pixels_per_point,
theme,
max_steps,
step_dt,
state: _,
@@ -93,6 +94,7 @@ impl<'a, State> Harness<'a, State> {
wait_for_pending_images,
} = builder;
let ctx = ctx.unwrap_or_default();
ctx.set_theme(theme);
ctx.enable_accesskit();
// Disable cursor blinking so it doesn't interfere with snapshots
ctx.all_styles_mut(|style| style.visuals.text_cursor.blink = false);