WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Support multiple app icon sizes #79

@Johnnycyan

Description

@Johnnycyan

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

I should preface this is probably only an issue on Windows.

The main problem here is that no matter what size image I use for an icon it always will look bad in at least 1 scenario. Whether it be that it looks bad in the program's title bar, it looks bad in the Start Menu, or it looks bad in the Taskbar. This is because Fyne's packaging seems to only support 1 icon size. Whereas most applications actually use a .ico package that contains sizes of 16, 24, 32, 48, 64, 128, and 256 pixels. having all these options means the program doesn't have to apply scaling to the image which creates bad aliasing artifacts. I can confirm this is the case by opening a Fyne packaged .exe with Resource Hacker and see only the 1 icon size. This is even the case if you give the .toml file an .ico package with multiple sizes. Whereas opening any other normal application with Resource Hacker results in seeing all of those icon sizes. This issue is actually fixed if you manually create a .ico package and replace the existing icon inside the .exe with Resource Hacker. But Fyne's Packager should by default create these multi-sized icon packages automatically or at the very least let me supply an already created one and actually respect it.

How to reproduce

  1. Package a go file including an icon with Fyne for Windows e.g. fyne package -os windows --release true
  2. Observe how the icon looks for various locations in Windows (Taskbar, Start Menu, File Browser etc.)

Screenshots

Example with supplying the Fyne packager with a multi-sized .ico resulting in a single 16px icon in the .exe file.

Looks fine in file explorer:
image

Looks terrible in Start Menu:
image

Looks terrible in Taskbar:
image

Looks good in application title bar:
image

Example after replacing the icon with Resource Hacker.

Looks great in file explorer:
image

Looks great in Start Menu:
image

Looks great in Taskbar:
image

Looks great in application title bar:
image

Example code

Has nothing to do with code

Fyne version

v2.3.6-0.20230717215520-4e63455578cc

Go compiler version

1.20.6

Operating system and version

Windows 11 22H2

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions