mirror of
https://github.com/italicsjenga/muda.git
synced 2024-12-23 20:11:29 +11:00
refactor: change submenu set_as functions
This commit is contained in:
parent
48472232fe
commit
bb92b5667e
5
.changes/macos-window-menu.md
Normal file
5
.changes/macos-window-menu.md
Normal file
|
@ -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`
|
|
@ -126,8 +126,8 @@ impl Submenu {
|
||||||
/// This will cause macOS to automatically add window-switching items and
|
/// This will cause macOS to automatically add window-switching items and
|
||||||
/// certain other items to the menu.
|
/// certain other items to the menu.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn set_windows_menu_for_nsapp(&self) {
|
pub fn set_as_windows_menu_for_nsapp(&self) {
|
||||||
self.0.borrow_mut().set_windows_menu_for_nsapp()
|
self.0.borrow_mut().set_as_windows_menu_for_nsapp()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set this submenu as the Help menu for the application on macOS.
|
/// 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
|
/// If no menu is set as the Help menu, macOS will automatically use any menu
|
||||||
/// which has a title matching the localized word "Help".
|
/// which has a title matching the localized word "Help".
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn set_help_menu_for_nsapp(&self) {
|
pub fn set_as_help_menu_for_nsapp(&self) {
|
||||||
self.0.borrow_mut().set_help_menu_for_nsapp()
|
self.0.borrow_mut().set_as_help_menu_for_nsapp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -541,11 +541,11 @@ impl MenuChild {
|
||||||
show_context_menu(self.ns_menu.1, view, position)
|
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) }
|
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] }
|
unsafe { msg_send![NSApp(), setHelpMenu: self.ns_menu.1] }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue