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: Allow disabling the icon background #310

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Aug 6, 2024

Part of: #190

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

Currently the user must create a new .svg file like icon_transparent.svg that is empty and provide it as the UnoIconBackgroundFile - as leaving this empty will fallback to icon.svg.

What is the new behavior?

New attribute allows setting UseIconBackground to false, which will not use the background file while generating, and will keep the foreground file only instead.

I made a follow up PR unoplatform/uno#17855 in Uno.UI to add a prop to control this and then default this to false on WASM, desktop and WinUI, where users most commonly don't want a background behind the icon.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

@MartinZikmund
Copy link
Member Author

TODO docs, waiting for approval that this approach makes sense

@MartinZikmund
Copy link
Member Author

@jeromelaban can you confirm this approach works?

@MartinZikmund
Copy link
Member Author

This approach is compatible with #239

@@ -50,6 +50,8 @@ internal class ResizeImageInfo

public bool IsAppIcon { get; set; }

public bool UseBackgroundFile { get; set; } = true;
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test with a validation for this part?

@MartinZikmund MartinZikmund self-assigned this Nov 25, 2024
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.

2 participants