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`.
This commit is contained in:
Héctor Ramón Jiménez 2021-09-15 15:31:40 +07:00
parent 93fec8d273
commit c0ab988842
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
21 changed files with 19 additions and 673 deletions

View file

@ -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;
}
}
}