-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Automatic switching between Dark and Light themes #204
Comments
Yes, that would be definitely a nice to have feature 👍 |
I did something like this myself by checking the system color theme when the main window of my app is activated and updating the FlatLaf theme if the system theme has changed. I've included my example code. Within this code, I call a custom Also, my Linux system color theme detection is only made to work for Linux Mint's Cinnamon desktop environment since that's all my app supports. I haven't investigated theme detection for any other flavors of Linux. Obviously, this will not update the app theme the instant the system theme is changed, but it will update it the next time the user goes back to the app. Also, obviously, I do these same checks on launch to set the correct initial FlatLaf theme. If there is any better idea about how to update the FlatLaf theme dynamically to match the system theme whenever it changes, I would be very interest to hear about it!
|
For Gnome (and therefore Ubuntu) do |
I guess you can gain some inspiration in https://github.com/Dansoftowner/jSystemThemeDetector. |
Operating systems increasingly provide a setting for system-wide dark-light theme preference. This often accompanied by an option to switch based on local day-night cycle.
Adding to FlatLaF the ability to either dynamically or at launch follow the system preference for dark or light theme would be appreciated.
The text was updated successfully, but these errors were encountered: