From 9fc5ad23edca93553137100d167de7b69e88f785 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 5 Jul 2021 16:23:44 -0300 Subject: Initial menu implementation --- src/application.rs | 11 ++++++++++- src/lib.rs | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/application.rs b/src/application.rs index bda8558c..b3dae1b3 100644 --- a/src/application.rs +++ b/src/application.rs @@ -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 { + 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.0.menu() + } } #[cfg(target_arch = "wasm32")] diff --git a/src/lib.rs b/src/lib.rs index 6a029afd..50952777 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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, }; -- cgit