fix: changed IconMenuItem::set_native_icon to take &self

This commit is contained in:
Amr Bashir 2023-08-19 17:27:39 +03:00
parent a9f16c8519
commit e046132dfb
No known key found for this signature in database
GPG key ID: BBD7A47A2003FF33
4 changed files with 8 additions and 3 deletions

5
.changes/native_icon.md Normal file
View file

@ -0,0 +1,5 @@
---
"muda": "patch"
---
Changed `IconMenuItem::set_native_icon` to take `&self` instead of `&mut self`.

View file

@ -176,7 +176,7 @@ impl IconMenuItem {
/// ## Platform-specific: /// ## Platform-specific:
/// ///
/// - **Windows / Linux**: Unsupported. /// - **Windows / Linux**: Unsupported.
pub fn set_native_icon(&mut self, _icon: Option<NativeIcon>) { pub fn set_native_icon(&self, _icon: Option<NativeIcon>) {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
self.inner.borrow_mut().set_native_icon(_icon) self.inner.borrow_mut().set_native_icon(_icon)
} }

View file

@ -132,7 +132,7 @@ impl Submenu {
self.inner.borrow_mut().remove(item) self.inner.borrow_mut().remove(item)
} }
/// Remove the menu item at the specified position from this submenu. /// Remove the menu item at the specified position from this submenu and returns it.
pub fn remove_at(&self, position: usize) -> Option<MenuItemKind> { pub fn remove_at(&self, position: usize) -> Option<MenuItemKind> {
let mut items = self.items(); let mut items = self.items();
if items.len() > position { if items.len() > position {

View file

@ -144,7 +144,7 @@ impl Menu {
self.inner.borrow_mut().remove(item) self.inner.borrow_mut().remove(item)
} }
/// Remove the menu item at the specified position from this menu. /// Remove the menu item at the specified position from this menu and returns it.
pub fn remove_at(&self, position: usize) -> Option<MenuItemKind> { pub fn remove_at(&self, position: usize) -> Option<MenuItemKind> {
let mut items = self.items(); let mut items = self.items();
if items.len() > position { if items.len() > position {