From ffc3ac317e725991f6d3ebcb0610f2a7b49a9584 Mon Sep 17 00:00:00 2001 From: Blake Gardner Date: Thu, 17 Sep 2026 21:07:46 -0500 Subject: [PATCH] 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 --- test/src/emulator.rs | 7 +++++++ test/src/simulator.rs | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/src/emulator.rs b/test/src/emulator.rs index bdb2415c..20c52f59 100644 --- a/test/src/emulator.rs +++ b/test/src/emulator.rs @@ -273,6 +273,11 @@ impl Emulator

{ 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 Emulator

{ &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, ); diff --git a/test/src/simulator.rs b/test/src/simulator.rs index 63fbe3f7..20972088 100644 --- a/test/src/simulator.rs +++ b/test/src/simulator.rs @@ -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,