Possible bug with Systray and transparency
Possible bug with Systray and transparency
I don't think the AddSysTrayIcon and ChangeSysTrayIcon commands support template images on macOS. This means that sometimes, the wrong icon / icon color is shown depending if Dark Mode and/or transparency is used.
Re: Possible bug with Systray and transparency
Could you post a small snippet ?
Re: Possible bug with Systray and transparency
Thanks for responding, Fred. I don't have code to post, but can illustrate:
https://ibb.co/Tmd68Fg
The white icon in the menu bar is a PNG file loaded in dark mode while using a transparent menu bar when using the Addsystray and Changesystray commands. It should be dark like the rest of the icons since macOS will detect the current theme and use the PNG asset's mask.
However, if a system menu is built manually using CocoaMessage commands (without using the Systray). For example, CocoaMessage(0,ImageID(0),"setTemplate:",#True), the same icon would display correctly (dark) because macOS will use its mask because it will be treated as a template per https://developer.apple.com/documentati ... ppearances
Systray is preferable for many situations because it generates a proper event and the commands do a lot of things to make life easy.
Hopefully, this makes sense.
https://ibb.co/Tmd68Fg
The white icon in the menu bar is a PNG file loaded in dark mode while using a transparent menu bar when using the Addsystray and Changesystray commands. It should be dark like the rest of the icons since macOS will detect the current theme and use the PNG asset's mask.
However, if a system menu is built manually using CocoaMessage commands (without using the Systray). For example, CocoaMessage(0,ImageID(0),"setTemplate:",#True), the same icon would display correctly (dark) because macOS will use its mask because it will be treated as a template per https://developer.apple.com/documentati ... ppearances
Systray is preferable for many situations because it generates a proper event and the commands do a lot of things to make life easy.
Hopefully, this makes sense.
Re: Possible bug with Systray and transparency
So should we always use template on the image when adding it to the SysTray or is there cases where it can be useful to have the original image ?
Re: Possible bug with Systray and transparency
Ideally, it could be a parameter (true or false). I appreciate this is extra work, but you do have these precedents - for example, when Windows supports some enhancement.
Re: Possible bug with Systray and transparency
So it should be a flag on LoadImage() and CatchImage() (MacOS only) ?
Re: Possible bug with Systray and transparency
If that approach is easier for you, then I am supportive. Thanks
Re: Possible bug with Systray and transparency
Thanks, moved to feature request to have 'template' like image support in PB.
Re: Possible bug with Systray and transparency
Thank you for the consideration