Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add set_icon_with_as_template #204

Merged
merged 5 commits into from
Nov 21, 2024
Merged

feat: add set_icon_with_as_template #204

merged 5 commits into from
Nov 21, 2024

Conversation

mrexox
Copy link
Contributor

@mrexox mrexox commented Nov 6, 2024

Closes #203

I am not sure this is correct in 100% cases but it feels more natural that when you change the icon you want the similar settings for its icon_is_template value.

@mrexox mrexox marked this pull request as ready for review November 6, 2024 13:57
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

set_icon_as_template was provided separately because it doesn't exist on other operating systems, this also doesn't fix usage DX that much because if you need to set a normal icon, you will have to

tray.set_icon_as_template(false);
tray.set_icon(new_icon);

which IMO is worse than current API and counter-intutive.

I think we can instead add set_icon_with_as_template or something that allows the caller to specify both,

@mrexox mrexox requested a review from amrbashir November 19, 2024 15:09
@mrexox
Copy link
Contributor Author

mrexox commented Nov 19, 2024

Adding a new method requires a contribution to the main Tauri repo, right?

@amrbashir
Copy link
Member

Adding a new method requires a contribution to the main Tauri repo, right?

That's correct

Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Could you also add a change file in .changes directory?

src/platform_impl/macos/mod.rs Show resolved Hide resolved
@mrexox mrexox changed the title fix: inherit icon_is_template in set_icon feat: add set_icon_with_as_template Nov 20, 2024
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Thank you

@amrbashir amrbashir merged commit 1f0e1f8 into tauri-apps:dev Nov 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not reset icon_is_template when chaning the icon with set_icon
2 participants