diff --git a/.changes/macos-window-menu.md b/.changes/macos-window-menu.md new file mode 100644 index 0000000..4c463ad --- /dev/null +++ b/.changes/macos-window-menu.md @@ -0,0 +1,5 @@ +--- +"muda": "minor" +--- + +On macOS, changed `Submenu::set_windows_menu_for_nsapp` and `Submenu::set_help_menu_for_nsapp` to `Submenu::set_as_windows_menu_for_nsapp` and `Submenu::set_as_help_menu_for_nsapp` diff --git a/src/items/submenu.rs b/src/items/submenu.rs index 209994d..ba60c5e 100644 --- a/src/items/submenu.rs +++ b/src/items/submenu.rs @@ -126,8 +126,8 @@ impl Submenu { /// This will cause macOS to automatically add window-switching items and /// certain other items to the menu. #[cfg(target_os = "macos")] - pub fn set_windows_menu_for_nsapp(&self) { - self.0.borrow_mut().set_windows_menu_for_nsapp() + pub fn set_as_windows_menu_for_nsapp(&self) { + self.0.borrow_mut().set_as_windows_menu_for_nsapp() } /// Set this submenu as the Help menu for the application on macOS. @@ -137,8 +137,8 @@ impl Submenu { /// If no menu is set as the Help menu, macOS will automatically use any menu /// which has a title matching the localized word "Help". #[cfg(target_os = "macos")] - pub fn set_help_menu_for_nsapp(&self) { - self.0.borrow_mut().set_help_menu_for_nsapp() + pub fn set_as_help_menu_for_nsapp(&self) { + self.0.borrow_mut().set_as_help_menu_for_nsapp() } } diff --git a/src/platform_impl/macos/mod.rs b/src/platform_impl/macos/mod.rs index fac7348..c0df7c6 100644 --- a/src/platform_impl/macos/mod.rs +++ b/src/platform_impl/macos/mod.rs @@ -541,11 +541,11 @@ impl MenuChild { show_context_menu(self.ns_menu.1, view, position) } - pub fn set_windows_menu_for_nsapp(&self) { + pub fn set_as_windows_menu_for_nsapp(&self) { unsafe { NSApp().setWindowsMenu_(self.ns_menu.1) } } - pub fn set_help_menu_for_nsapp(&self) { + pub fn set_as_help_menu_for_nsapp(&self) { unsafe { msg_send![NSApp(), setHelpMenu: self.ns_menu.1] } }