Skip to content

Conversation

@s00d
Copy link
Contributor

@s00d s00d commented Jun 27, 2025

This PR adds support for icons (custom and native) in submenus for both the Rust (tauri) and JS/TS (@tauri-apps/api) APIs.
Submenus can now display icons just like regular menu items.

image
  • SubmenuOptions now accepts an icon field.
  • The Submenu class provides setIcon and setNativeIcon methods.
  • Rust API supports icon and nativeIcon for submenus via builder and methods.
  • Usage examples are added to the documentation and demo app.

Closes: #11796


  • Changefile added in .changes/ (minor:enhance)
  • All commits are signed
  • cargo test and cargo clippy pass locally for the new code
  • PR is ready for review

@s00d s00d requested a review from a team as a code owner June 27, 2025 12:59
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Jun 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2025

Package Changes Through 736ebd7

There are 7 changes which include tauri-cli with minor, @tauri-apps/cli with minor, tauri-utils with minor, tauri-bundler with patch, tauri with minor, @tauri-apps/api with minor, tauri-plugin with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.7.0 2.8.0
tauri-utils 2.6.0 2.7.0
tauri-bundler 2.5.2 2.5.3
tauri-runtime 2.7.1 2.7.2
tauri-runtime-wry 2.7.2 2.7.3
tauri-codegen 2.3.1 2.3.2
tauri-macros 2.3.2 2.3.3
tauri-plugin 2.3.1 2.4.0
tauri-build 2.3.1 2.3.2
tauri 2.7.0 2.8.0
@tauri-apps/cli 2.7.1 2.8.0
tauri-cli 2.7.1 2.8.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars added this to the 2.7 milestone Jun 27, 2025
@FabianLars
Copy link
Member

Thank you for the PR! We just released 2.6 so we'll have to keep the dev branch open for patch changes for a few days/weeks. Just so you can prepare for a bit of a delay here :)

Btw, the rust code comments aren't in english yet and your commits (expect the last 2 merge commits) aren't signed :)

@s00d s00d force-pushed the dev branch 2 times, most recently from ca78be7 to 92038a7 Compare June 27, 2025 14:47
@s00d
Copy link
Contributor Author

s00d commented Jun 27, 2025

Thank you for the PR! We just released 2.6 so we'll have to keep the dev branch open for patch changes for a few days/weeks. Just so you can prepare for a bit of a delay here :)

Btw, the rust code comments aren't in english yet and your commits (expect the last 2 merge commits) aren't signed :)

Thank you for your feedback!
I've fixed the main issues, updated the Rust code comments to English, signed my commits, and squashed everything into a single commit to keep the history clean.
No problem about the delay — I’m happy to wait as long as needed.
Thanks again, and let me know if there’s anything else I should address.

@FabianLars FabianLars modified the milestones: 2.7, 2.8 Jul 22, 2025
@Legend-Master
Copy link
Contributor

Didn't look at the details yet, but it doesn't seem to work for me on Windows (clicked Create menu with Image icon and then Popup), is it supposed to work on Windows?

image

@s00d
Copy link
Contributor Author

s00d commented Jul 25, 2025

Didn't look at the details yet, but it doesn't seem to work for me on Windows (clicked Create menu with Image icon and then Popup), is it supposed to work on Windows?

image

I apologize, I overlooked that menu formation works slightly differently on Windows in the tray context, so I've created a pull request with the necessary fixes

PR #308

Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, and works for me on Windows as well now, left some comments and will do a proper review tomorrow

@s00d
Copy link
Contributor Author

s00d commented Jul 29, 2025

@Legend-Master Fixed your comments. Also added set_icon and set_native_icon in crates/tauri/src/menu/submenu.rs.

Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thanks!

@Legend-Master Legend-Master merged commit 5ba1c3f into tauri-apps:dev Jul 30, 2025
23 of 25 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

3 participants