Attach tester to daemon
This commit is contained in:
parent
0a34496c79
commit
25a96f8efc
2 changed files with 21 additions and 14 deletions
|
|
@ -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)?)
|
||||
|
|
|
|||
|
|
@ -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>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue