Skip to content

Commit

Permalink
feat(core): add tauri::Builder::enable_macos_default_menu (#5756)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Dec 7, 2022
1 parent 0f26960 commit 8866eca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/macos-disable-default-menu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": "minor"
---

Add `tauri::Builder::enable_macos_default_menu` to enable or disable the default menu creation on macOS.
15 changes: 15 additions & 0 deletions core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,21 @@ impl<R: Runtime> Builder<R> {
self
}

/// Enable or disable the default menu on macOS. Enabled by default.
///
/// # Examples
/// ```
/// use tauri::{MenuEntry, Submenu, MenuItem, Menu, CustomMenuItem};
///
/// tauri::Builder::default()
/// .enable_macos_default_menu(false);
/// ```
#[must_use]
pub fn enable_macos_default_menu(mut self, enable: bool) -> Self {
self.enable_macos_default_menu = enable;
self
}

/// Registers a menu event handler for all windows.
///
/// # Examples
Expand Down

0 comments on commit 8866eca

Please sign in to comment.