mirror of
https://github.com/italicsjenga/muda.git
synced 2024-12-23 12:01:31 +11:00
fix: changed IconMenuItem::set_native_icon
to take &self
This commit is contained in:
parent
a9f16c8519
commit
e046132dfb
5
.changes/native_icon.md
Normal file
5
.changes/native_icon.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"muda": "patch"
|
||||||
|
---
|
||||||
|
|
||||||
|
Changed `IconMenuItem::set_native_icon` to take `&self` instead of `&mut self`.
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue