From d0f79d2779d00752eef78cd98b6904cd888d59e3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 23 Nov 2019 20:23:38 +0100 Subject: Make `tour` work with `iced_web` again :tada: - Implements `TextInput`, `Scrollable`, and `Container` - Adds basic style generation --- src/application.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/application.rs') 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 { as iced_winit::Application>::run(); #[cfg(target_arch = "wasm32")] - iced_web::Application::run(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) { + let (app, command) = A::new(); + + (Instance(app), command) } - fn view(&mut self) -> Element { + fn title(&self) -> String { + self.0.title() + } + + fn update(&mut self, message: Self::Message) -> Command { + self.0.update(message) + } + + fn view(&mut self) -> Element<'_, Self::Message> { self.0.view() } } -- cgit