Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Big Sur dynamically switches between black and white icons depending on desktop background #84

Closed
6twenty opened this issue Feb 13, 2021 · 6 comments

Comments

@6twenty
Copy link

6twenty commented Feb 13, 2021

This means that choosing the image style based on whether dark mode is enabled or not is not sufficient to choose the correct image, as the menu bar may be using black icons or white icons regardless. This is a screenshot of my mac with dark mode enabled, but a light desktop background image, and setting anybar to the "black" image:

image

My desktop image is a dynamic wallpaper, so in the evening it's much darker and the mac switches to using white icons.

@6twenty
Copy link
Author

6twenty commented Feb 14, 2021

Not that I know anything about Mac app development, but on reading up about this it sounds like the most reliable solution is to set setTemplate:YES on the "black" and "white" images so that the os can invert them automatically when it wants to use white menu bar icons instead of black ones. I imagine this would mean also removing the _dark code that switches to the "_alt" variants.

@tonsky
Copy link
Owner

tonsky commented Feb 14, 2021

Well the trick with _dark is that on "black" on light scheme is a filled circle but empty donut on a dark theme. It changes shape, otherwise filled black circle will become filled white circle, and calling filled white circle "black" is weird.

Is there any way to detect when Big Sur changes menubar color?

@6twenty
Copy link
Author

6twenty commented Feb 14, 2021

Ah, that's a good point. From the searches I did, no, there's no known Big Sur API to detect when it switches between white & black icons.

Would it be an option to add entirely separate images instead? E.g. "donut" and "fill" - using names that don't relate to light or dark at all - that have setTemplate:YES on just those ones?

@tonsky
Copy link
Owner

tonsky commented Feb 14, 2021

I am thinking making them black with white outline (black) and white with black outline (white). That way they will work on both backgrounds, without switching.

@tonsky tonsky closed this as completed in d32ad60 Feb 18, 2021
@tonsky
Copy link
Owner

tonsky commented Feb 18, 2021

Made filled and hollow, added inverted borders to black and white, removed _alt versions. Published 0.2.3. Thanks!

@6twenty
Copy link
Author

6twenty commented Feb 18, 2021

💐 thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants