Merge pull request #66 from hecrj/feature/new-web-tour
Make `tour` work with `iced_web` again
This commit is contained in:
commit
bbcd16c335
20 changed files with 936 additions and 87 deletions
|
|
@ -83,7 +83,7 @@ pub trait Application: Sized {
|
|||
/// The type of __messages__ your [`Application`] will produce.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
type Message: std::fmt::Debug + Send;
|
||||
type Message: std::fmt::Debug + Send + Clone;
|
||||
|
||||
/// Initializes the [`Application`].
|
||||
///
|
||||
|
|
@ -140,7 +140,7 @@ pub trait Application: Sized {
|
|||
<Instance<Self> as iced_winit::Application>::run();
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
iced_web::Application::run(Instance(self));
|
||||
<Instance<Self> as iced_web::Application>::run();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,11 +180,21 @@ where
|
|||
{
|
||||
type Message = A::Message;
|
||||
|
||||
fn update(&mut self, message: Self::Message) {
|
||||
self.0.update(message);
|
||||
fn new() -> (Self, Command<A::Message>) {
|
||||
let (app, command) = A::new();
|
||||
|
||||
(Instance(app), command)
|
||||
}
|
||||
|
||||
fn view(&mut self) -> Element<Self::Message> {
|
||||
fn title(&self) -> String {
|
||||
self.0.title()
|
||||
}
|
||||
|
||||
fn update(&mut self, message: Self::Message) -> Command<Self::Message> {
|
||||
self.0.update(message)
|
||||
}
|
||||
|
||||
fn view(&mut self) -> Element<'_, Self::Message> {
|
||||
self.0.view()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ pub trait Sandbox {
|
|||
/// The type of __messages__ your [`Sandbox`] will produce.
|
||||
///
|
||||
/// [`Sandbox`]: trait.Sandbox.html
|
||||
type Message: std::fmt::Debug + Send;
|
||||
type Message: std::fmt::Debug + Send + Clone;
|
||||
|
||||
/// Initializes the [`Sandbox`].
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue