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

Why resizetizer adds margin to all icons for Windows? #286

Open
xperiandri opened this issue Jun 4, 2024 · 4 comments
Open

Why resizetizer adds margin to all icons for Windows? #286

xperiandri opened this issue Jun 4, 2024 · 4 comments
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@xperiandri
Copy link

xperiandri commented Jun 4, 2024

Current behavior

Margin is added to all icons

Expected behavior

Margin is added to tiles only by taking icon.svg size as the total size and icon_foreground.svg as relative to the total.
For all the other icons no margin is added

Environment

Package Version(s): 5.2.139

Affected platform(s):

  • Windows
  • Build tasks

Visual Studio:

  • 2022
@xperiandri xperiandri added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Jun 4, 2024
@agneszitte agneszitte changed the title Why resizer adds margin to all icons for Windows? Why resizetizer adds margin to all icons for Windows? Jun 5, 2024
@agneszitte
Copy link
Contributor

(cc @MartinZikmund, @dansiegel)

@dansiegel
Copy link
Contributor

@xperiandri I don't see any sample app to look at for reference of what you're seeing issues with. I'm assuming that what you're seeing is a result of the default Scale on the App Icon Foreground image which has long been a default value from the Uno Template and is now part of the Uno.Sdk. You could change the ForegroundScale for Windows to achieve what you'd like.

https://github.com/unoplatform/uno/blob/f1aa1b96c616eb1cfc543a48767c6c640f6520f6/src/Uno.Sdk/targets/Uno.DefaultItems.Resizetizer.targets#L8C40-L8C62

https://github.com/unoplatform/uno.templates/blob/c8399400d98e5122b1186431b2a814dc4d393a71/src/Uno.Templates/content/unoapp/MyExtensionsApp._1.Base/base.props#L21

@xperiandri
Copy link
Author

@dansiegel thank you very much for such precise pointing.
This is what I need.
2 more things:

  1. Can I override the scale for Windows tiles only?
  2. Can I replace the particular image somehow? Imagine I want to replace TileWide, can I do that with another SVG?

@dansiegel
Copy link
Contributor

  1. Can I override the scale for Windows tiles only?

Yes you can certainly override just for Windows. How exactly you do that would depend on what version the project template you created your project with.

<PropertyGroup>
  <!-- Using Uno.Sdk without the UnoIcon defined -->
  <!-- https://platform.uno/docs/articles/external/uno.resizetizer/doc/using-uno-resizetizer.html?tabs=singleproject%2CAndroid#utilizing-sdk-properties -->
  <UnoIconForegroundScale Condition="$(TargetFramework.Contains('windows10'))">1.0</UnoIconForegroundScale>
</PropertyGroup>

<ItemGroup>
  <!-- Legacy projects (generally in the base.props -->
  <!-- https://platform.uno/docs/articles/external/uno.resizetizer/doc/uno-resizetizer-properties.html#unoicon -->
  <UnoIcon Include="$(MSBuildThisFileDirectory)Icons\icon.svg"
        ForegroundFile="$(MSBuildThisFileDirectory)Icons\icon_foreground.svg"
        ForegroundScale="0.65"
        WindowsForegroundScale="1.0"
        Color="#00000000" />
</ItemGroup>
  1. Can I replace the particular image somehow? Imagine I want to replace TileWide, can I do that with another SVG?

While you can swap out the Scale or even the foreground (icon) file used based on platform, there is no way to say use one asset for the Wide Icon on Windows while using a different icon for the square icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

3 participants