Attach tester to daemon

This commit is contained in:
Héctor Ramón Jiménez 2025-10-08 02:53:37 +02:00
parent 0a34496c79
commit 25a96f8efc
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F
2 changed files with 21 additions and 14 deletions

View file

@ -134,18 +134,20 @@ impl<P: Program> Daemon<P> {
Self: 'static,
P::Message: message::MaybeDebug + message::MaybeClone,
{
#[cfg(all(feature = "debug", not(target_arch = "wasm32")))]
let program = {
iced_debug::init(iced_debug::Metadata {
name: P::name(),
theme: None,
can_time_travel: cfg!(feature = "time-travel"),
});
#[cfg(feature = "debug")]
iced_debug::init(iced_debug::Metadata {
name: P::name(),
theme: None,
can_time_travel: cfg!(feature = "time-travel"),
});
iced_devtools::attach(self)
};
#[cfg(feature = "tester")]
let program = iced_tester::attach(self);
#[cfg(any(not(feature = "debug"), target_arch = "wasm32"))]
#[cfg(all(feature = "debug", not(feature = "tester")))]
let program = iced_devtools::attach(self);
#[cfg(not(any(feature = "tester", feature = "debug")))]
let program = self;
Ok(shell::run(program)?)

View file

@ -65,10 +65,15 @@ where
}
fn window(&self) -> Option<window::Settings> {
self.program.window().map(|window| window::Settings {
size: window.size + Size::new(300.0, 80.0),
..window
})
Some(
self.program
.window()
.map(|window| window::Settings {
size: window.size + Size::new(300.0, 80.0),
..window
})
.unwrap_or_default(),
)
}
fn boot(&self) -> (Self::State, Task<Self::Message>) {