feat: add icon to submenu
This PR introduces the ability to add icons to submenu items on macOS by providing a new set_icon and set_native_icon method in the Submenu API.
What’s Changed
- macOS: Implemented icon support for submenus, enabling developers to display an icon next to their submenu entries.
- Windows: Implemented icon support for submenus by allowing a submenu’s icon to be set just like regular menu items.
- Linux: Implemented icon support for submenus by allowing a submenu’s icon to be set just like regular menu items.
- Submenu: Added a new
set_iconandset_native_iconmethod to change the icon after the submenu has been created.
Thank you for reviewing this pull request!
Fully completed the implementation and tested it on macOS, Windows, and Linux. It seems there are no issues with how it runs. As an example, I added the ability to launch on Linux (there’s a warning that there’s no parent, but it doesn’t interfere with testing—this warning only appears in the example).
The task is related to:
- https://github.com/tauri-apps/tauri/issues/11796
- https://github.com/mediar-ai/screenpipe/issues/1306
@amrbashir Hi, can you take a look?
thanks @s00d for the PR. However this would need to wait until I finish #272, and after that I will remove IconMenuItem and add set_icon on the bare MenuItem and Submenu.
@amrbashir @s00d Would absolutely love to see this 👍🏻 I assume the gtk4 migration will be quite huge and take a long time so maybe merge this for now?
I think I fixed everything you mentioned. I tested it on macOS, Linux, and Windows — everything works fine on my side.
https://github.com/s00d/muda/actions/runs/15685668646 https://github.com/s00d/muda/actions/runs/15685668656
Fixed all the errors and formatting. Had to enable actions on my side — not very convenient to test cross-platform software.
@s00d thank you