From 9fc5ad23edca93553137100d167de7b69e88f785 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 5 Jul 2021 16:23:44 -0300 Subject: Initial menu implementation --- glutin/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glutin') diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml index 78d5fe47..b42a6b36 100644 --- a/glutin/Cargo.toml +++ b/glutin/Cargo.toml @@ -15,8 +15,8 @@ debug = ["iced_winit/debug"] [dependencies.glutin] version = "0.27" -git = "https://github.com/iced-rs/glutin" -rev = "2564d0ab87cf2ad824a2a58733aebe40dd2f29bb" +# git = "https://github.com/iced-rs/glutin" +# rev = "2564d0ab87cf2ad824a2a58733aebe40dd2f29bb" [dependencies.iced_native] version = "0.4" -- cgit From 31997d255f263a0f47f5af0d8560f3d5bd37f077 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 12 Jul 2021 22:28:18 +0200 Subject: Store and synchronize `Menu` in `application::State` --- glutin/src/application.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'glutin') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index a8e5dbf9..279b6c77 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -52,11 +52,14 @@ where runtime.track(subscription); let context = { - let builder = settings.window.into_builder( - &application.title(), - application.mode(), - event_loop.primary_monitor(), - ); + let builder = settings + .window + .into_builder( + &application.title(), + application.mode(), + event_loop.primary_monitor(), + ) + .with_menu(Some(conversion::menu(&application.menu()))); let context = ContextBuilder::new() .with_vsync(true) -- cgit From 6221adf2b1b1e8150931d4175e1e36870d45f6e5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 13 Jul 2021 20:55:21 +0200 Subject: Draft `conversion::menu_message` in `iced_winit` ... and wire it up to the runtime loop --- glutin/src/application.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'glutin') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 279b6c77..991c8705 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -306,6 +306,16 @@ async fn run_instance( // TODO: Handle animations! // Maybe we can use `ControlFlow::WaitUntil` for this. } + event::Event::WindowEvent { + event: event::WindowEvent::MenuEntryActivated(entry_id), + .. + } => { + if let Some(message) = + conversion::menu_message(state.menu(), entry_id) + { + messages.push(message); + } + } event::Event::WindowEvent { event: window_event, .. -- cgit From 82db3c78b6cfa2cc55ece6ffa46811bfb5195f60 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 20 Jul 2021 21:34:20 +0700 Subject: Update `winit` and `glutin` dependencies ... and remove crates.io patch --- glutin/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glutin') diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml index b42a6b36..b2a7f307 100644 --- a/glutin/Cargo.toml +++ b/glutin/Cargo.toml @@ -15,8 +15,8 @@ debug = ["iced_winit/debug"] [dependencies.glutin] version = "0.27" -# git = "https://github.com/iced-rs/glutin" -# rev = "2564d0ab87cf2ad824a2a58733aebe40dd2f29bb" +git = "https://github.com/iced-rs/glutin" +rev = "03437d8a1826d83c62017b2bb7bf18bfc9e352cc" [dependencies.iced_native] version = "0.4" -- cgit