summaryrefslogtreecommitdiffstats
path: root/src/application.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-23 20:23:38 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-23 20:23:38 +0100
commitd0f79d2779d00752eef78cd98b6904cd888d59e3 (patch)
tree436e757d7b24ae9791dc554d341b38d6646285d3 /src/application.rs
parent3a678561f2da92e089390ee79bd4f9efc2c1a8c7 (diff)
downloadiced-d0f79d2779d00752eef78cd98b6904cd888d59e3.tar.gz
iced-d0f79d2779d00752eef78cd98b6904cd888d59e3.tar.bz2
iced-d0f79d2779d00752eef78cd98b6904cd888d59e3.zip
Make `tour` work with `iced_web` again :tada:
- Implements `TextInput`, `Scrollable`, and `Container` - Adds basic style generation
Diffstat (limited to 'src/application.rs')
-rw-r--r--src/application.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/application.rs b/src/application.rs
index 5ecb901e..d761c990 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -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()
}
}