Initial menu implementation

This commit is contained in:
Richard 2021-07-05 16:23:44 -03:00
parent 4994d34aba
commit 9fc5ad23ed
14 changed files with 487 additions and 8 deletions

View file

@ -1,6 +1,6 @@
use crate::window;
use crate::{
Clipboard, Color, Command, Element, Executor, Settings, Subscription,
Clipboard, Color, Command, Element, Executor, Menu, Settings, Subscription,
};
/// An interactive cross-platform application.
@ -191,6 +191,11 @@ pub trait Application: Sized {
false
}
/// TODO
fn menu(&self) -> Menu<Self::Message> {
Menu::new()
}
/// Runs the [`Application`].
///
/// On native platforms, this method will take control of the current thread
@ -296,6 +301,10 @@ where
fn should_exit(&self) -> bool {
self.0.should_exit()
}
fn menu(&self) -> Menu<Self::Message> {
self.0.menu()
}
}
#[cfg(target_arch = "wasm32")]

View file

@ -246,6 +246,6 @@ pub use settings::Settings;
pub use runtime::{
futures, Align, Background, Clipboard, Color, Command, Font,
HorizontalAlignment, Length, Point, Rectangle, Size, Subscription, Vector,
VerticalAlignment,
HorizontalAlignment, Length, Menu, Point, Rectangle, Size, Subscription,
Vector, VerticalAlignment,
};