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

[bug] Debian icons have mixed sources (png & icns) with tauricon defaults #4280

Closed
betamos opened this issue Jun 6, 2022 · 0 comments
Closed

Comments

@betamos
Copy link
Contributor

betamos commented Jun 6, 2022

Describe the bug

When using tauricon to generate app icons, the .deb bundle sources its icons from different files. Notably, this includes the .icns file. The docs state that file endings png, ico and icns correspond to Linux, Windows and MacOS respectively.

In particular, the files generated include all sizes from the icns file, if it is present. Looking at the source, it appears possible that also the ico file can be used.

I am using a different icon source file for MacOS (see reasons below), and when building a .deb, I get icons mixed in from the icns file.

Reproduction

  1. Generate an icon set from a source png using tauricon.
  2. Set the default/recommended(?) tauri.bundle.icon in tauri.conf.json:
    [icons/32x32.png, icons/128x128.png, icons/128x128@2x.png, icons/icon.icns, icons/icon.ico]
  3. Swap out the icns file for an entirely different icns file.
  4. Build the deb
  5. Verify the different icons in the data/usr/share/icons/hicolor dir. Some are from the icns, some are from the pngs. I see 10 different png files in different sizes and resolutions (compared with the 3 pngs in the src-tauri/icons dir).

Expected behavior

Honestly, it depends. I think the least surprising way is to copy over png files only, without the fallback. A lot of complexity is removed if png, ico and icns are platform-specific, and the fallback is removed. Omitting the fallback also allows power users to customize further, since only pngs are used in the long run. However, this would silently break icons for any user who currently does not have png files set up correctly.

Another option is to generate pngs from tauricon in even more resolutions and sizes, in order to prevent the fallback to kick in at all. However, this is quite wasteful and error prone to future changes.

That said, I haven't looked into the interactions with other uses of icons, such as the sys tray. Not sure if that changes anything.

Platform and versions

This is present in dev today.

Stack trace

No response

Additional context

There are several reasons one would use different icons for different platforms, and even multiple icon sources per platform:

  • In Apple's icon grid, the icon border has an inset from the actual image size (so that certain elements can "stick out" of the icon"). If you create such an image to fit for Mac, it will look too small on Windows and Linux.
  • On Mac it is very common with rounded squares, which are less common elsewhere. Discord, for instance, uses a circular unshaded icon on Linux and a shaded squircle on Mac.
  • On smaller sizes, details and bevel are often removed to make the icon more distinct and less cluttered.

I think it's fine with a default that uses a single source file, but it's important that this can be customized if necessary.

betamos added a commit to betamos/tauri that referenced this issue Jun 7, 2022
Previously, all icon sources were consulted, and all sizes were used,
resulting in 10 icons with tauricon defaults for linux targets. Now,
only pngs are used for linux, which is consistent with other platforms.

fixes tauri-apps#4280
betamos added a commit to betamos/tauri that referenced this issue Jun 7, 2022
Previously, all icon sources were consulted, and all sizes were used,
resulting in 10 icons with tauricon defaults for linux targets. Now,
only pngs are used for linux, which is consistent with other platforms.

fixes tauri-apps#4280
betamos added a commit to betamos/tauri that referenced this issue Jun 7, 2022
Previously, all icon sources were consulted, and all sizes were used,
resulting in 10 icons with tauricon defaults for linux targets. Now,
only pngs are used for linux, which is consistent with other platforms.

fixes tauri-apps#4280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants