menu.rs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. use std::{
  5. collections::hash_map::DefaultHasher,
  6. fmt,
  7. hash::{Hash, Hasher},
  8. };
  9. pub type MenuHash = u16;
  10. pub type MenuId = String;
  11. pub type MenuIdRef<'a> = &'a str;
  12. /// Named images defined by the system.
  13. #[cfg(target_os = "macos")]
  14. #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
  15. #[derive(Debug, Clone)]
  16. pub enum NativeImage {
  17. /// An add item template image.
  18. Add,
  19. /// Advanced preferences toolbar icon for the preferences window.
  20. Advanced,
  21. /// A Bluetooth template image.
  22. Bluetooth,
  23. /// Bookmarks image suitable for a template.
  24. Bookmarks,
  25. /// A caution image.
  26. Caution,
  27. /// A color panel toolbar icon.
  28. ColorPanel,
  29. /// A column view mode template image.
  30. ColumnView,
  31. /// A computer icon.
  32. Computer,
  33. /// An enter full-screen mode template image.
  34. EnterFullScreen,
  35. /// Permissions for all users.
  36. Everyone,
  37. /// An exit full-screen mode template image.
  38. ExitFullScreen,
  39. /// A cover flow view mode template image.
  40. FlowView,
  41. /// A folder image.
  42. Folder,
  43. /// A burnable folder icon.
  44. FolderBurnable,
  45. /// A smart folder icon.
  46. FolderSmart,
  47. /// A link template image.
  48. FollowLinkFreestanding,
  49. /// A font panel toolbar icon.
  50. FontPanel,
  51. /// A `go back` template image.
  52. GoLeft,
  53. /// A `go forward` template image.
  54. GoRight,
  55. /// Home image suitable for a template.
  56. Home,
  57. /// An iChat Theater template image.
  58. IChatTheater,
  59. /// An icon view mode template image.
  60. IconView,
  61. /// An information toolbar icon.
  62. Info,
  63. /// A template image used to denote invalid data.
  64. InvalidDataFreestanding,
  65. /// A generic left-facing triangle template image.
  66. LeftFacingTriangle,
  67. /// A list view mode template image.
  68. ListView,
  69. /// A locked padlock template image.
  70. LockLocked,
  71. /// An unlocked padlock template image.
  72. LockUnlocked,
  73. /// A horizontal dash, for use in menus.
  74. MenuMixedState,
  75. /// A check mark template image, for use in menus.
  76. MenuOnState,
  77. /// A MobileMe icon.
  78. MobileMe,
  79. /// A drag image for multiple items.
  80. MultipleDocuments,
  81. /// A network icon.
  82. Network,
  83. /// A path button template image.
  84. Path,
  85. /// General preferences toolbar icon for the preferences window.
  86. PreferencesGeneral,
  87. /// A Quick Look template image.
  88. QuickLook,
  89. /// A refresh template image.
  90. RefreshFreestanding,
  91. /// A refresh template image.
  92. Refresh,
  93. /// A remove item template image.
  94. Remove,
  95. /// A reveal contents template image.
  96. RevealFreestanding,
  97. /// A generic right-facing triangle template image.
  98. RightFacingTriangle,
  99. /// A share view template image.
  100. Share,
  101. /// A slideshow template image.
  102. Slideshow,
  103. /// A badge for a `smart` item.
  104. SmartBadge,
  105. /// Small green indicator, similar to iChat’s available image.
  106. StatusAvailable,
  107. /// Small clear indicator.
  108. StatusNone,
  109. /// Small yellow indicator, similar to iChat’s idle image.
  110. StatusPartiallyAvailable,
  111. /// Small red indicator, similar to iChat’s unavailable image.
  112. StatusUnavailable,
  113. /// A stop progress template image.
  114. StopProgressFreestanding,
  115. /// A stop progress button template image.
  116. StopProgress,
  117. /// An image of the empty trash can.
  118. TrashEmpty,
  119. /// An image of the full trash can.
  120. TrashFull,
  121. /// Permissions for a single user.
  122. User,
  123. /// User account toolbar icon for the preferences window.
  124. UserAccounts,
  125. /// Permissions for a group of users.
  126. UserGroup,
  127. /// Permissions for guests.
  128. UserGuest,
  129. }
  130. #[derive(Debug, Clone)]
  131. pub enum MenuUpdate {
  132. /// Modifies the enabled state of the menu item.
  133. SetEnabled(bool),
  134. /// Modifies the title (label) of the menu item.
  135. SetTitle(String),
  136. /// Modifies the selected state of the menu item.
  137. SetSelected(bool),
  138. /// Update native image.
  139. #[cfg(target_os = "macos")]
  140. #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
  141. SetNativeImage(NativeImage),
  142. }
  143. pub trait TrayHandle: fmt::Debug + Clone + Send + Sync {
  144. fn set_icon(&self, icon: crate::Icon) -> crate::Result<()>;
  145. fn set_menu(&self, menu: crate::menu::SystemTrayMenu) -> crate::Result<()>;
  146. fn update_item(&self, id: u16, update: MenuUpdate) -> crate::Result<()>;
  147. #[cfg(target_os = "macos")]
  148. fn set_icon_as_template(&self, is_template: bool) -> crate::Result<()>;
  149. fn destroy(&self) -> crate::Result<()>;
  150. }
  151. /// A window menu.
  152. #[derive(Debug, Default, Clone)]
  153. #[non_exhaustive]
  154. pub struct Menu {
  155. pub items: Vec<MenuEntry>,
  156. }
  157. #[derive(Debug, Clone)]
  158. #[non_exhaustive]
  159. pub struct Submenu {
  160. pub title: String,
  161. pub enabled: bool,
  162. pub inner: Menu,
  163. }
  164. impl Submenu {
  165. /// Creates a new submenu with the given title and menu items.
  166. pub fn new<S: Into<String>>(title: S, menu: Menu) -> Self {
  167. Self {
  168. title: title.into(),
  169. enabled: true,
  170. inner: menu,
  171. }
  172. }
  173. }
  174. impl Menu {
  175. /// Creates a new window menu.
  176. pub fn new() -> Self {
  177. Default::default()
  178. }
  179. /// Creates a menu filled with default menu items and submenus.
  180. ///
  181. /// ## Platform-specific:
  182. ///
  183. /// - **Windows**:
  184. /// - File
  185. /// - CloseWindow
  186. /// - Quit
  187. /// - Edit
  188. /// - Cut
  189. /// - Copy
  190. /// - Paste
  191. /// - Window
  192. /// - Minimize
  193. /// - CloseWindow
  194. ///
  195. /// - **Linux**:
  196. /// - File
  197. /// - CloseWindow
  198. /// - Quit
  199. /// - Window
  200. /// - Minimize
  201. /// - CloseWindow
  202. ///
  203. /// - **macOS**:
  204. /// - App
  205. /// - About
  206. /// - Separator
  207. /// - Services
  208. /// - Separator
  209. /// - Hide
  210. /// - HideOthers
  211. /// - ShowAll
  212. /// - Separator
  213. /// - Quit
  214. /// - File
  215. /// - CloseWindow
  216. /// - Edit
  217. /// - Undo
  218. /// - Redo
  219. /// - Separator
  220. /// - Cut
  221. /// - Copy
  222. /// - Paste
  223. /// - SelectAll
  224. /// - View
  225. /// - EnterFullScreen
  226. /// - Window
  227. /// - Minimize
  228. /// - Zoom
  229. /// - Separator
  230. /// - CloseWindow
  231. pub fn os_default(#[allow(unused)] app_name: &str) -> Self {
  232. let mut menu = Menu::new();
  233. #[cfg(target_os = "macos")]
  234. {
  235. menu = menu.add_submenu(Submenu::new(
  236. app_name,
  237. Menu::new()
  238. .add_native_item(MenuItem::About(
  239. app_name.to_string(),
  240. AboutMetadata::default(),
  241. ))
  242. .add_native_item(MenuItem::Separator)
  243. .add_native_item(MenuItem::Services)
  244. .add_native_item(MenuItem::Separator)
  245. .add_native_item(MenuItem::Hide)
  246. .add_native_item(MenuItem::HideOthers)
  247. .add_native_item(MenuItem::ShowAll)
  248. .add_native_item(MenuItem::Separator)
  249. .add_native_item(MenuItem::Quit),
  250. ));
  251. }
  252. let mut file_menu = Menu::new();
  253. file_menu = file_menu.add_native_item(MenuItem::CloseWindow);
  254. #[cfg(not(target_os = "macos"))]
  255. {
  256. file_menu = file_menu.add_native_item(MenuItem::Quit);
  257. }
  258. menu = menu.add_submenu(Submenu::new("File", file_menu));
  259. #[cfg(not(target_os = "linux"))]
  260. let mut edit_menu = Menu::new();
  261. #[cfg(target_os = "macos")]
  262. {
  263. edit_menu = edit_menu.add_native_item(MenuItem::Undo);
  264. edit_menu = edit_menu.add_native_item(MenuItem::Redo);
  265. edit_menu = edit_menu.add_native_item(MenuItem::Separator);
  266. }
  267. #[cfg(not(target_os = "linux"))]
  268. {
  269. edit_menu = edit_menu.add_native_item(MenuItem::Cut);
  270. edit_menu = edit_menu.add_native_item(MenuItem::Copy);
  271. edit_menu = edit_menu.add_native_item(MenuItem::Paste);
  272. }
  273. #[cfg(target_os = "macos")]
  274. {
  275. edit_menu = edit_menu.add_native_item(MenuItem::SelectAll);
  276. }
  277. #[cfg(not(target_os = "linux"))]
  278. {
  279. menu = menu.add_submenu(Submenu::new("Edit", edit_menu));
  280. }
  281. #[cfg(target_os = "macos")]
  282. {
  283. menu = menu.add_submenu(Submenu::new(
  284. "View",
  285. Menu::new().add_native_item(MenuItem::EnterFullScreen),
  286. ));
  287. }
  288. let mut window_menu = Menu::new();
  289. window_menu = window_menu.add_native_item(MenuItem::Minimize);
  290. #[cfg(target_os = "macos")]
  291. {
  292. window_menu = window_menu.add_native_item(MenuItem::Zoom);
  293. window_menu = window_menu.add_native_item(MenuItem::Separator);
  294. }
  295. window_menu = window_menu.add_native_item(MenuItem::CloseWindow);
  296. menu = menu.add_submenu(Submenu::new("Window", window_menu));
  297. menu
  298. }
  299. /// Creates a new window menu with the given items.
  300. ///
  301. /// # Examples
  302. /// ```
  303. /// # use tauri_runtime::menu::{Menu, MenuItem, CustomMenuItem, Submenu};
  304. /// Menu::with_items([
  305. /// MenuItem::SelectAll.into(),
  306. /// #[cfg(target_os = "macos")]
  307. /// MenuItem::Redo.into(),
  308. /// CustomMenuItem::new("toggle", "Toggle visibility").into(),
  309. /// Submenu::new("View", Menu::new()).into(),
  310. /// ]);
  311. /// ```
  312. pub fn with_items<I: IntoIterator<Item = MenuEntry>>(items: I) -> Self {
  313. Self {
  314. items: items.into_iter().collect(),
  315. }
  316. }
  317. /// Adds the custom menu item to the menu.
  318. #[must_use]
  319. pub fn add_item(mut self, item: CustomMenuItem) -> Self {
  320. self.items.push(MenuEntry::CustomItem(item));
  321. self
  322. }
  323. /// Adds a native item to the menu.
  324. #[must_use]
  325. pub fn add_native_item(mut self, item: MenuItem) -> Self {
  326. self.items.push(MenuEntry::NativeItem(item));
  327. self
  328. }
  329. /// Adds an entry with submenu.
  330. #[must_use]
  331. pub fn add_submenu(mut self, submenu: Submenu) -> Self {
  332. self.items.push(MenuEntry::Submenu(submenu));
  333. self
  334. }
  335. }
  336. /// A custom menu item.
  337. #[derive(Debug, Clone)]
  338. #[non_exhaustive]
  339. pub struct CustomMenuItem {
  340. pub id: MenuHash,
  341. pub id_str: MenuId,
  342. pub title: String,
  343. pub keyboard_accelerator: Option<String>,
  344. pub enabled: bool,
  345. pub selected: bool,
  346. #[cfg(target_os = "macos")]
  347. pub native_image: Option<NativeImage>,
  348. }
  349. impl CustomMenuItem {
  350. /// Create new custom menu item.
  351. pub fn new<I: Into<String>, T: Into<String>>(id: I, title: T) -> Self {
  352. let id_str = id.into();
  353. Self {
  354. id: Self::hash(&id_str),
  355. id_str,
  356. title: title.into(),
  357. keyboard_accelerator: None,
  358. enabled: true,
  359. selected: false,
  360. #[cfg(target_os = "macos")]
  361. native_image: None,
  362. }
  363. }
  364. /// Assign a keyboard shortcut to the menu action.
  365. #[must_use]
  366. pub fn accelerator<T: Into<String>>(mut self, accelerator: T) -> Self {
  367. self.keyboard_accelerator.replace(accelerator.into());
  368. self
  369. }
  370. #[cfg(target_os = "macos")]
  371. #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
  372. #[must_use]
  373. /// A native image do render on the menu item.
  374. pub fn native_image(mut self, image: NativeImage) -> Self {
  375. self.native_image.replace(image);
  376. self
  377. }
  378. /// Mark the item as disabled.
  379. #[must_use]
  380. pub fn disabled(mut self) -> Self {
  381. self.enabled = false;
  382. self
  383. }
  384. /// Mark the item as selected.
  385. #[must_use]
  386. pub fn selected(mut self) -> Self {
  387. self.selected = true;
  388. self
  389. }
  390. fn hash(id: &str) -> MenuHash {
  391. let mut hasher = DefaultHasher::new();
  392. id.hash(&mut hasher);
  393. hasher.finish() as MenuHash
  394. }
  395. }
  396. /// A system tray menu.
  397. #[derive(Debug, Default, Clone)]
  398. #[non_exhaustive]
  399. pub struct SystemTrayMenu {
  400. pub items: Vec<SystemTrayMenuEntry>,
  401. }
  402. #[derive(Debug, Clone)]
  403. #[non_exhaustive]
  404. pub struct SystemTraySubmenu {
  405. pub title: String,
  406. pub enabled: bool,
  407. pub inner: SystemTrayMenu,
  408. }
  409. impl SystemTraySubmenu {
  410. /// Creates a new submenu with the given title and menu items.
  411. pub fn new<S: Into<String>>(title: S, menu: SystemTrayMenu) -> Self {
  412. Self {
  413. title: title.into(),
  414. enabled: true,
  415. inner: menu,
  416. }
  417. }
  418. }
  419. impl SystemTrayMenu {
  420. /// Creates a new system tray menu.
  421. pub fn new() -> Self {
  422. Default::default()
  423. }
  424. /// Adds the custom menu item to the system tray menu.
  425. #[must_use]
  426. pub fn add_item(mut self, item: CustomMenuItem) -> Self {
  427. self.items.push(SystemTrayMenuEntry::CustomItem(item));
  428. self
  429. }
  430. /// Adds a native item to the system tray menu.
  431. #[must_use]
  432. pub fn add_native_item(mut self, item: SystemTrayMenuItem) -> Self {
  433. self.items.push(SystemTrayMenuEntry::NativeItem(item));
  434. self
  435. }
  436. /// Adds an entry with submenu.
  437. #[must_use]
  438. pub fn add_submenu(mut self, submenu: SystemTraySubmenu) -> Self {
  439. self.items.push(SystemTrayMenuEntry::Submenu(submenu));
  440. self
  441. }
  442. }
  443. /// An entry on the system tray menu.
  444. #[derive(Debug, Clone)]
  445. pub enum SystemTrayMenuEntry {
  446. /// A custom item.
  447. CustomItem(CustomMenuItem),
  448. /// A native item.
  449. NativeItem(SystemTrayMenuItem),
  450. /// An entry with submenu.
  451. Submenu(SystemTraySubmenu),
  452. }
  453. /// System tray menu item.
  454. #[derive(Debug, Clone)]
  455. #[non_exhaustive]
  456. pub enum SystemTrayMenuItem {
  457. /// A separator.
  458. Separator,
  459. }
  460. /// An entry on the system tray menu.
  461. #[derive(Debug, Clone)]
  462. pub enum MenuEntry {
  463. /// A custom item.
  464. CustomItem(CustomMenuItem),
  465. /// A native item.
  466. NativeItem(MenuItem),
  467. /// An entry with submenu.
  468. Submenu(Submenu),
  469. }
  470. impl From<CustomMenuItem> for MenuEntry {
  471. fn from(item: CustomMenuItem) -> Self {
  472. Self::CustomItem(item)
  473. }
  474. }
  475. impl From<MenuItem> for MenuEntry {
  476. fn from(item: MenuItem) -> Self {
  477. Self::NativeItem(item)
  478. }
  479. }
  480. impl From<Submenu> for MenuEntry {
  481. fn from(submenu: Submenu) -> Self {
  482. Self::Submenu(submenu)
  483. }
  484. }
  485. /// Application metadata for the [`MenuItem::About`] action.
  486. ///
  487. /// ## Platform-specific
  488. ///
  489. /// - **Windows / macOS / Android / iOS:** The metadata is ignored on these platforms.
  490. #[derive(Debug, Clone, Default)]
  491. #[non_exhaustive]
  492. pub struct AboutMetadata {
  493. /// The application name.
  494. pub version: Option<String>,
  495. /// The authors of the application.
  496. pub authors: Option<Vec<String>>,
  497. /// Application comments.
  498. pub comments: Option<String>,
  499. /// The copyright of the application.
  500. pub copyright: Option<String>,
  501. /// The license of the application.
  502. pub license: Option<String>,
  503. /// The application website.
  504. pub website: Option<String>,
  505. /// The website label.
  506. pub website_label: Option<String>,
  507. }
  508. impl AboutMetadata {
  509. /// Creates the default metadata for the [`MenuItem::About`] action, which is just empty.
  510. pub fn new() -> Self {
  511. Default::default()
  512. }
  513. /// Defines the application version.
  514. pub fn version(mut self, version: impl Into<String>) -> Self {
  515. self.version.replace(version.into());
  516. self
  517. }
  518. /// Defines the application authors.
  519. pub fn authors(mut self, authors: Vec<String>) -> Self {
  520. self.authors.replace(authors);
  521. self
  522. }
  523. /// Defines the application comments.
  524. pub fn comments(mut self, comments: impl Into<String>) -> Self {
  525. self.comments.replace(comments.into());
  526. self
  527. }
  528. /// Defines the application copyright.
  529. pub fn copyright(mut self, copyright: impl Into<String>) -> Self {
  530. self.copyright.replace(copyright.into());
  531. self
  532. }
  533. /// Defines the application license.
  534. pub fn license(mut self, license: impl Into<String>) -> Self {
  535. self.license.replace(license.into());
  536. self
  537. }
  538. /// Defines the application version.
  539. pub fn website(mut self, website: impl Into<String>) -> Self {
  540. self.website.replace(website.into());
  541. self
  542. }
  543. /// Defines the application version.
  544. pub fn website_label(mut self, website_label: impl Into<String>) -> Self {
  545. self.website_label.replace(website_label.into());
  546. self
  547. }
  548. }
  549. /// A menu item, bound to a pre-defined action or `Custom` emit an event. Note that status bar only
  550. /// supports `Custom` menu item variants. And on the menu bar, some platforms might not support some
  551. /// of the variants. Unsupported variant will be no-op on such platform.
  552. #[derive(Debug, Clone)]
  553. #[non_exhaustive]
  554. pub enum MenuItem {
  555. /// Shows a standard "About" item.
  556. ///
  557. /// The first value is the application name, and the second is its metadata.
  558. ///
  559. /// ## Platform-specific
  560. ///
  561. /// - **Windows / Android / iOS:** Unsupported
  562. /// - **Linux:** The metadata is only applied on Linux
  563. ///
  564. About(String, AboutMetadata),
  565. /// A standard "hide the app" menu item.
  566. ///
  567. /// ## Platform-specific
  568. ///
  569. /// - **Android / iOS:** Unsupported
  570. ///
  571. Hide,
  572. /// A standard "Services" menu item.
  573. ///
  574. /// ## Platform-specific
  575. ///
  576. /// - **Windows / Linux / Android / iOS:** Unsupported
  577. ///
  578. Services,
  579. /// A "hide all other windows" menu item.
  580. ///
  581. /// ## Platform-specific
  582. ///
  583. /// - **Windows / Linux / Android / iOS:** Unsupported
  584. ///
  585. HideOthers,
  586. /// A menu item to show all the windows for this app.
  587. ///
  588. /// ## Platform-specific
  589. ///
  590. /// - **Windows / Linux / Android / iOS:** Unsupported
  591. ///
  592. ShowAll,
  593. /// Close the current window.
  594. ///
  595. /// ## Platform-specific
  596. ///
  597. /// - **Android / iOS:** Unsupported
  598. ///
  599. CloseWindow,
  600. /// A "quit this app" menu icon.
  601. ///
  602. /// ## Platform-specific
  603. ///
  604. /// - **Android / iOS:** Unsupported
  605. ///
  606. Quit,
  607. /// A menu item for enabling copying (often text) from responders.
  608. ///
  609. /// ## Platform-specific
  610. ///
  611. /// - **Android / iOS / Linux:** Unsupported
  612. ///
  613. Copy,
  614. /// A menu item for enabling cutting (often text) from responders.
  615. ///
  616. /// ## Platform-specific
  617. ///
  618. /// - **Android / iOS / Linux:** Unsupported
  619. ///
  620. Cut,
  621. /// An "undo" menu item; particularly useful for supporting the cut/copy/paste/undo lifecycle
  622. /// of events.
  623. ///
  624. /// ## Platform-specific
  625. ///
  626. /// - **Windows / Linux / Android / iOS:** Unsupported
  627. ///
  628. Undo,
  629. /// An "redo" menu item; particularly useful for supporting the cut/copy/paste/undo lifecycle
  630. /// of events.
  631. ///
  632. /// ## Platform-specific
  633. ///
  634. /// - **Windows / Linux / Android / iOS:** Unsupported
  635. ///
  636. Redo,
  637. /// A menu item for selecting all (often text) from responders.
  638. ///
  639. /// ## Platform-specific
  640. ///
  641. /// - **Windows / Android / iOS / Linux:** Unsupported
  642. ///
  643. SelectAll,
  644. /// A menu item for pasting (often text) into responders.
  645. ///
  646. /// ## Platform-specific
  647. ///
  648. /// - **Android / iOS / Linux:** Unsupported
  649. ///
  650. Paste,
  651. /// A standard "enter full screen" item.
  652. ///
  653. /// ## Platform-specific
  654. ///
  655. /// - **Windows / Linux / Android / iOS:** Unsupported
  656. ///
  657. EnterFullScreen,
  658. /// An item for minimizing the window with the standard system controls.
  659. ///
  660. /// ## Platform-specific
  661. ///
  662. /// - **Android / iOS:** Unsupported
  663. ///
  664. Minimize,
  665. /// An item for instructing the app to zoom
  666. ///
  667. /// ## Platform-specific
  668. ///
  669. /// - **Windows / Linux / Android / iOS:** Unsupported
  670. ///
  671. Zoom,
  672. /// Represents a Separator
  673. ///
  674. /// ## Platform-specific
  675. ///
  676. /// - **Android / iOS:** Unsupported
  677. ///
  678. Separator,
  679. }