diff options
author | 2021-09-15 15:31:40 +0700 | |
---|---|---|
committer | 2021-09-15 15:31:40 +0700 | |
commit | c0ab9888426b7d1f2606afafc9dba06eed7f9419 (patch) | |
tree | 909d04f52e5b2bb51a5784b855a77b45d4a53592 /winit/src/application/state.rs | |
parent | 93fec8d273ef8305e1c2456abe0c8ecd7a9d9407 (diff) | |
download | iced-c0ab9888426b7d1f2606afafc9dba06eed7f9419.tar.gz iced-c0ab9888426b7d1f2606afafc9dba06eed7f9419.tar.bz2 iced-c0ab9888426b7d1f2606afafc9dba06eed7f9419.zip |
Revert system menus support
The current implementation has some important issues on Windows. We will reintroduce the feature once we figure them out!
I have kept some of the changes in #945, like the new `keyboard::Modifiers` powered by `bitflags`.
Diffstat (limited to 'winit/src/application/state.rs')
-rw-r--r-- | winit/src/application/state.rs | 19 |
1 files changed, 1 insertions, 18 deletions
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; - } } } |