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

Use system colors as defaults (dark mode fix) #707

Open
spyoungtech opened this issue Jun 14, 2021 · 3 comments
Open

Use system colors as defaults (dark mode fix) #707

spyoungtech opened this issue Jun 14, 2021 · 3 comments

Comments

@spyoungtech
Copy link

spyoungtech commented Jun 14, 2021

By default, Gooey chooses the default color scheme for apps.

In dark mode, this can make apps a bit difficult to use, particularly on MacOS. For example, when dark mode is in use, I notice the header text is not visible, fields are difficult to see, and the button text is not readable:

image

I would suggest that, by default, Gooey should use the system colors, which will account for dark mode and other user-configured OS options. I.E. using wx.SystemSettings.GetColour. This way, applications use color schemes according to user system preferences.

@spyoungtech
Copy link
Author

spyoungtech commented Jun 14, 2021

Using system colors, dark mode might look something like this:

image

(or colors might inverse)

@enorms
Copy link

enorms commented Jun 17, 2021

I noticed that too! From the Widget Example on Mac:
Screen Shot 2021-06-16 at 9 19 12 PM
In Light Mode
Screen Shot 2021-06-16 at 9 19 46 PM
In Dark Mode

On Mac, the state can be determined by a subprocess output:

>>> # in dark mode
>>> wx.SystemSettings.GetAppearance().IsDark()
False
>>> import subprocess
>>> subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell=True).communicate()
(b'Dark\n', b'')
>>> # in light mode
>>> wx.SystemSettings.GetAppearance().IsDark()
False
>>> subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell=True).communicate()
(b'', b'2021-06-16 21:25:45.850 defaults[40272:12750955] \nThe domain/default pair of (kCFPreferencesAnyApplication, AppleInterfaceStyle) does not exist\n')

@ustun
Copy link

ustun commented May 18, 2022

@enxyz

wx.SystemSettings.GetAppearance().IsDark()

seems buggy, but

wx.SystemSettings.GetAppearance().IsUsingDarkBackground()

seems to work fine for me on MacOS 12.3.1.

The docs seem to suggest otherwise though: https://wxpython.org/Phoenix/docs/html/wx.SystemAppearance.html

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

No branches or pull requests

3 participants