fix(test): build iced_test against this fork's runtime and renderer style

`iced_test` has not compiled here since it arrived from upstream: it
matches `runtime::Action` exhaustively without the fork's `Dnd` and
`PlatformSpecific` variants, and builds `renderer::Style` without the
fork's `icon_color` and `scale_factor` fields. Nothing else in the
workspace depends on it, so the errors only show up in
`cargo test --workspace` and for anyone adding the crate to an
application.

The emulator ignores the two actions: drag and drop and platform
surfaces need a windowing system, which it has none of. The style
fields follow what the winit runtime passes: the icon color is the
text color, and the scale factor is the one the emulator or simulator
already renders its screenshot at.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Blake Gardner 2026-09-17 21:07:46 -05:00 • committed by Ashley Wulber
parent 85d4e4d5c2
commit ffc3ac317e
2 changed files with 11 additions and 2 deletions

View file

@ -273,6 +273,11 @@ impl<P: Program + 'static> Emulator<P> {
runtime::Action::Reload => {
// TODO
}
runtime::Action::Dnd(_)
| runtime::Action::PlatformSpecific(_) => {
// Drag and drop and platform surfaces need a
// windowing system, which an emulator has none of.
}
},
}
}
@ -474,7 +479,9 @@ impl<P: Program + 'static> Emulator<P> {
&mut self.renderer,
theme,
&renderer::Style {
icon_color: style.text_color,
text_color: style.text_color,
scale_factor: f64::from(scale_factor),
},
mouse::Cursor::Unavailable,
);

View file

@ -209,17 +209,19 @@ where
&mut self.messages,
);
let scale_factor = 2.0_f32;
self.raw.draw(
&mut self.renderer,
theme,
&core::renderer::Style {
icon_color: base.text_color,
text_color: base.text_color,
scale_factor: f64::from(scale_factor),
},
self.cursor,
);
let scale_factor = 2.0;
let physical_size = Size::new(
(self.size.width * scale_factor).round() as u32,
(self.size.height * scale_factor).round() as u32,