diff options
Diffstat (limited to '')
-rw-r--r-- | winit/src/application.rs | 19 | ||||
-rw-r--r-- | winit/src/application/state.rs | 19 |
2 files changed, 1 insertions, 37 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 722b4757..ab9a70a0 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -15,7 +15,6 @@ use iced_futures::futures; use iced_futures::futures::channel::mpsc; use iced_graphics::window; use iced_native::program::Program; -use iced_native::Menu; use iced_native::{Cache, UserInterface}; use std::mem::ManuallyDrop; @@ -100,13 +99,6 @@ pub trait Application: Program { fn should_exit(&self) -> bool { false } - - /// Returns the current system [`Menu`] of the [`Application`]. - /// - /// By default, it returns an empty [`Menu`]. - fn menu(&self) -> Menu<Self::Message> { - Menu::new() - } } /// Runs an [`Application`] with an executor, compositor, and the provided @@ -153,7 +145,6 @@ where event_loop.primary_monitor(), settings.id, ) - .with_menu(Some(conversion::menu(&application.menu()))) .build(&event_loop) .map_err(Error::WindowCreationFailed)?; @@ -420,16 +411,6 @@ async fn run_instance<A, E, C>( } } 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, .. } => { diff --git a/winit/src/application/state.rs b/winit/src/application/state.rs index f60f09be..b54d3aed 100644 --- a/winit/src/application/state.rs +++ b/winit/src/application/state.rs @@ -1,5 +1,5 @@ use crate::conversion; -use crate::{Application, Color, Debug, Menu, Mode, Point, Size, Viewport}; +use crate::{Application, Color, Debug, Mode, Point, Size, Viewport}; use std::marker::PhantomData; use winit::event::{Touch, WindowEvent}; @@ -9,7 +9,6 @@ use winit::window::Window; #[derive(Debug, Clone)] pub struct State<A: Application> { title: String, - menu: Menu<A::Message>, mode: Mode, background_color: Color, scale_factor: f64, @@ -24,7 +23,6 @@ impl<A: Application> State<A> { /// Creates a new [`State`] for the provided [`Application`] and window. pub fn new(application: &A, window: &Window) -> Self { let title = application.title(); - let menu = application.menu(); let mode = application.mode(); let background_color = application.background_color(); let scale_factor = application.scale_factor(); @@ -40,7 +38,6 @@ impl<A: Application> State<A> { Self { title, - menu, mode, background_color, scale_factor, @@ -53,11 +50,6 @@ impl<A: Application> State<A> { } } - /// Returns the current [`Menu`] of the [`State`]. - pub fn menu(&self) -> &Menu<A::Message> { - &self.menu - } - /// Returns the current background [`Color`] of the [`State`]. pub fn background_color(&self) -> Color { self.background_color @@ -211,14 +203,5 @@ impl<A: Application> State<A> { self.scale_factor = new_scale_factor; } - - // Update menu - let new_menu = application.menu(); - - if self.menu != new_menu { - window.set_menu(Some(conversion::menu(&new_menu))); - - self.menu = new_menu; - } } } |