muda icon indicating copy to clipboard operation
muda copied to clipboard

feat: add icon to submenu

Open s00d opened this issue 10 months ago • 3 comments

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_icon and set_native_icon method to change the icon after the submenu has been created.
image

Thank you for reviewing this pull request!

s00d avatar Feb 26 '25 20:02 s00d

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

s00d avatar Feb 27 '25 09:02 s00d

@amrbashir Hi, can you take a look?

s00d avatar Mar 03 '25 09:03 s00d

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 avatar Mar 03 '25 15:03 amrbashir

@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?

nikolas-sturm avatar May 21 '25 15:05 nikolas-sturm

I think I fixed everything you mentioned. I tested it on macOS, Linux, and Windows — everything works fine on my side.

s00d avatar Jun 14 '25 17:06 s00d

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 avatar Jun 16 '25 16:06 s00d

@s00d thank you

amrbashir avatar Jun 17 '25 01:06 amrbashir