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

Add support for macOS darkmode #857

Closed
freakboy3742 opened this issue Apr 23, 2020 · 5 comments
Closed

Add support for macOS darkmode #857

freakboy3742 opened this issue Apr 23, 2020 · 5 comments
Labels
bug A crash or error in behavior.

Comments

@freakboy3742
Copy link
Member

macOS 10.14 (Mojave) added Dark Mode; however, Toga doesn't honor dark mode defaults when setting up widgets.

Toga should identify when the app is running in dark mode, and use appropriate background/foreground colors instead of defaulting to dark text/light background.

@freakboy3742 freakboy3742 added bug A crash or error in behavior. up-for-grabs labels Apr 23, 2020
@samschott
Copy link
Member

Could you add examples of widgets that currently have hard-coded colours which do not honour dark mode? Most widgets seem to work just fine.

@freakboy3742
Copy link
Member Author

I was going off this report as a starting point, and assumed at least some of the problem would lie with Toga. It's possible that it may be entirely a Briefcase packaging issue, though.

If that's the case, then we can close this ticket, and move all the activity over to briefcase template ticket.

(Side note - I created this ticket, and a bunch of others, because we're sprinting this weekend; if you've got spare time, we'd love to see you there!

@samschott
Copy link
Member

I strongly suspect that this is a packaging issue. I've been packaging a toga app with PyInstaller (there was some issue with briefcase and a dependency which I don't quite recall at the moment) and getting dark mode to work required explicitly setting the NSRequiresAquaSystemAppearance flag to false in the info.plist for macOS < 10.14. For macOS >= 10.14, dark mode support should come automatically.

For PyInstaller however, I needed to rebuild the bootloader myself with a MACOSX_DEPLOYMENT_TARGET=10.13 or higher (overriding the PyInstaller default of 10.7) for dark mode to work. That also solved some other appearance issues with the Tree widget in the packaged app.

I assume that briefcase uses some form of precompiled Python interpreter as well and may face similar issues.

Also, thanks for invite to the sprint! But its unlikely that I will find the time this weekend :/

@kzys
Copy link

kzys commented Jan 11, 2022

Resolved?

According to beeware/briefcase-macOS-app-template#2

From my testing, this was enabled automatically when we moved to the binary-based bootstrap.

Also my app which is running from briefcase dev honors dark mode and can change colors dynamically when I change that from System Preferences.

@samschott
Copy link
Member

Yes, this has been resolved. Thanks for the ping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

3 participants