root3nl / SupportApp

The Support App is developed by Root3, specialized in managing Apple devices. Root3 offers consultancy and support for organizations to get the most out of their Apple devices and is based in The Netherlands (Halfweg).
https://www.root3.nl
MIT License
585 stars 60 forks source link

MenuBar icon only in greyscale? #142

Closed sudodaemon closed 7 months ago

sudodaemon commented 1 year ago

I have added a menu bar icon, but even thought the PNG file is in color it pulls up as greyscale. Is there a setting I am missing or is this expected behavior?

meta-github commented 1 year ago

Renderlng the icon as grayscale is currently hardcoded in the app, iirc. I think, this is to ensure that the alert flags are properly visible.

To display our company logo correctly, I have disabled the option to do the grayscaling as and changed the colors of the alerts.

sudodaemon commented 1 year ago

So wait, is there a way to disable the grayscale option? First you said its hard coded, then you said you disabled it...

meta-github commented 1 year ago

Yes, I disabled it by changing the source code.

sudodaemon commented 1 year ago

Could you point me in the right direction? I've been looking through a bunch of files but can't find anything relating to color other than dark mode, light mode, etc. Can't find anything relating to the menubar / notification icon.

meta-github commented 1 year ago

Look at src/Support/AppDelegate.swift:

uncomment the line button.image?.isTemplate = true and (optionally) change these lines for other colors: leStatusItemBadgeView(frame: .zero, color: .systemRed) and StatusItemBadgeView(frame: .zero, color: .systemOrange).

sudodaemon commented 1 year ago

Just in case anybody else is trying to do this, I found that the line wasn't commented out, it was just listed as True, so setting it to False was the key.

So it should be

button.image?.isTemplate = false

Maybe it was a typo on your end? Doesn't matter, point is, it fixed my issue and I am happy. Icon is in color now and it's been pushed out to all the computers I manage.

jordywitteman commented 7 months ago

Will close this issue as it is resolved by recompiling after code changes. We feel we should not provide the non-template option in the release version to maintain the native look and feel of the menu bar icon. Generally speaking, it should blend in nicely with the rest of the icons and adapt to changes like wallpaper and light/dark mode.