From 341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 19 Jun 2024 01:53:40 +0200 Subject: Introduce `daemon` API and unify shell runtimes --- examples/todos/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/todos') diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index c21e1a96..a834c946 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -17,7 +17,7 @@ pub fn main() -> iced::Result { #[cfg(not(target_arch = "wasm32"))] tracing_subscriber::fmt::init(); - iced::program(Todos::title, Todos::update, Todos::view) + iced::application(Todos::title, Todos::update, Todos::view) .load(Todos::load) .subscription(Todos::subscription) .font(include_bytes!("../fonts/icons.ttf").as_slice()) -- cgit From c5f4bebeda8d6ef10efade7933a5ee58f06b62d1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 20 Jun 2024 01:13:42 +0200 Subject: Remove `window::Id::MAIN` constant --- examples/todos/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/todos') diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index a834c946..6ed50d31 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -149,9 +149,10 @@ impl Todos { widget::focus_next() } } - Message::ToggleFullscreen(mode) => { - window::change_mode(window::Id::MAIN, mode) - } + Message::ToggleFullscreen(mode) => window::get_latest() + .and_then(move |window| { + window::change_mode(window, mode) + }), Message::Loaded(_) => Command::none(), }; -- cgit