From c0ab9888426b7d1f2606afafc9dba06eed7f9419 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 15 Sep 2021 15:31:40 +0700 Subject: 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`. --- winit/src/application/state.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'winit/src/application/state.rs') 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 { title: String, - menu: Menu, mode: Mode, background_color: Color, scale_factor: f64, @@ -24,7 +23,6 @@ impl State { /// 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 State { Self { title, - menu, mode, background_color, scale_factor, @@ -53,11 +50,6 @@ impl State { } } - /// Returns the current [`Menu`] of the [`State`]. - pub fn menu(&self) -> &Menu { - &self.menu - } - /// Returns the current background [`Color`] of the [`State`]. pub fn background_color(&self) -> Color { self.background_color @@ -211,14 +203,5 @@ impl State { 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; - } } } -- cgit