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

[Feature Request]: Allow the use of Tray icon *names* to allow for icon theming in supported platforms #41801

Open
3 tasks done
Darkhogg opened this issue Apr 8, 2024 · 0 comments

Comments

@Darkhogg
Copy link

Darkhogg commented Apr 8, 2024

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success. There is one issue marked as a wontfix from 6 years ago, I'm hoping that's enough time for a re-request

Problem Description

Currently, Electron applications have to bundle their own icons and hardcode their path when creating a Tray object. Some allow for a choice of style (full-color vs monocrhome, light vs dark) but the icons are still from hardcoded paths. In XDG-compliant systems like Linux, applications are not expected to select their own icons, but instead use a name for the icon, that will be later searched in the user's selected icon theme, so that the style of all icons in the system tray match.

Proposed Solution

The Tray object should support being provided with both an icon name as well as an icon image, so that the name is used in platforms that support it, falling back to the specified image if the name is not supported or not found.

Alternatives Considered

An external library could implement the XDG icon lookup algorithm (given in the official XDG icon theme specification page) and be called prior to creating the Tray object to pick the icon (I'm currently in the process of finding such a library).

This has the clear disadvantage that the icon lookup has to be made by the client, who might not be able to know the expected size, format, scale, etc. of the system tray, while otherwise passing the name of the icon leaves that decision to the underlying implementation.

Additional Information

No response

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

1 participant