Skip to content

Commit

Permalink
fix: [macOS] missing image on NSMenuItem with children (#197)
Browse files Browse the repository at this point in the history
Fixes #194
  • Loading branch information
knopp authored Sep 6, 2023
1 parent 0094f3a commit 5b62dab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions super_native_extensions/rust/src/darwin/macos/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ impl PlatformMenu {
Sel::from_ptr(std::ptr::null_mut()),
*to_nsstring(""),
);
if let Some(MenuImage::Image { data }) = &menu.image {
let image = ns_image_for_menu_item(data.clone());
let () = msg_send![item, setImage: *image];
}
let submenu = Self::translate_menu(menu, isolate, delegate.clone());
NSMenuItem::setSubmenu_(item, *submenu);
StrongPtr::new(item)
Expand Down

0 comments on commit 5b62dab

Please sign in to comment.