-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support template images on MacOS for menubar icons. #4549
Comments
There's a lot of interesting thoughts here, but I don't follow how having a version of an icon called "_templated" helps to use template icons in systray? |
Simply exposing |
Exposing a call particularly useful for macOS kinda goes against platform-agnostic design. Passing in a ThemedResource allows us to do the right thing per-platform under the hood. |
Fixed on the develop branch as proposed (passing theme.ThemedResource) will be available in v2.5.0 |
Checklist
Is your feature request related to a problem?
As mentioned in #4548,
fyne.io/v2/app
does not support template images which are the recommended format for system tray and menubar icons. This leads to an app that uses out-of-place colored icons or monochromatic icons which do not change in response to the system theme or to accessibility settings that call for high contrast. The only way to partially get this functionality is to importfyne.io/systray
directly and callSetTemplateIcon
, which allows at least the systray icon to be templated, however this does not extend toMenuItem
s.Is it possible to construct a solution with the existing API?
Only partially (see above).
Describe the solution you'd like to see.
This is a toughie, since icons are only available as
fyne.Resource
values. A medium-lift solution could involve adding aTemplatedResource
interface that these images could implement:Which would require changes to
fyne bundle
to accept a flag or a naming convention to embed certain resources with a type conforming to this interface; however a better solution would probably involve deeper changes tofyne bundle
(and resources overall) allowing bundle to detect file types and even embed platform-specific assets following a similar convention to Go build flag suffixes for filenames, such that:would result in two resources:
resourceMyIcon
, which would be tagged as an image with mac and !mac variants andresourceMySecondIcon
, which would be tagged as an image with windows and templated mac variants and a fallback to be used on other platforms.This is likely getting into v3 territory, however.
The text was updated successfully, but these errors were encountered: