-
-
Notifications
You must be signed in to change notification settings - Fork 531
[#1089] Add dark mode theme & custom UI font size #2261
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
Conversation
This method works also for dark mode
# Conflicts: # swing/src/net/sf/openrocket/gui/dialogs/ComponentAnalysisDialog.java # swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurablePanel.java
This is from a custom build of darklaf where I removed the 20 offset from shadowSize (see weisJ/darklaf#347)
|
I will test it for myself as soon as the build passes. I am not a dark mode aficionado but the screenshots look reasonable (not what I would want to ever use, though). Maybe the text is a bit too grey, could be brighter? Seems to be a bit less contrast overall than I would want to see, but maybe that's how dark mode generally looks, dunno. |
|
Here is a JAR file for testing. Build is failing because of reasons I don't want to solve right now 🙃. Troubles for future Sibo... |
I'm an avid dark mode user, it's not unusual for the contrast to be like this. I could adjust it if need be, but it's a pretty standard dark mode look. |
In that case I defer to your judgment. I'll give the JAR file a whirl when I get a chance. |
|
Tried it out on Java 17 on my Mac (running OS13.2.1). Looked like your screenshots. :) The fades on the left and right edges of the component icons don't look great in dark mode, but probably not worth messing with. When I clicked on the pulldown to switch to "3D finished" view, I got an exception. |
Does the exception go away when you run the JAR with |
See darklaf issue openrocket#343: weisJ/darklaf#343
This is really just a failsafe in case the dark theme cause OR to crash
|
Okay, I added a hotfix for the Java 17 issue and compiled darklaf myself (see my branch). So, the dark mode should run fine now. I've tested it on my macOS machine an Parallels Desktop versions of Windows and Linux, but I'd very much like a quick test from @JoePfeiffer, @hcraigmiller and @neilweinstock to verify that it works. |
|
Currently out of town at NARAM -- I should be able to look at it Wednesday or Thursday. |
Even better, then you can let the rocketeers there test it 😉. Good luck and have fun! |
|
@neilweinstock @JoePfeiffer could you run a quick test on this to see whether nothing crashes? |
|
Quick test here worked fine. I note that many of the component icons don't look great in dark mode, but I think we can address that later if desired. |
|
Looks good to me; no issues when I tried it. It's unfortunate that a restart is required to see the changes, but I expect that's a limitation you can't do anything about. Any particular reason for the max/min font sizes? I expect that especially allowing larger ones would assist people with vision problems. I agree with @neilweinstock that we should go ahead and do this, and worry about improving the icons for dark mode later if at all. |
Yup. It's technically possible, but extremely tricky in our situation since we have a rather complex UI with components all over the place. Not something I want to attempt to fix...
I increased the range a bit. I just don't want users to not know how the sizing works and enter a huge number such as 100, resulting in completely unusable UI in which they can't even reset their UI font size to a normal level. |
This PR fixes #1089 and implements a dark mode theme to OR using the Darklaf library (which looks a bit better than the FlatLaf dark mode theme). Additionally, you can also change the UI font size in the preferences.
I'm gonna mark this as a draft for now, because there is a bug on Windows and Linux where Darklaf throws an exception when running on Java 17 (and maybe also Java 11?). I've filed a bug report for it here. I may try to fix the darklaf source code to fix this issue, we'll see. But, I already want to put this PR up so people can test it (looking at you @neilweinstock, please be gentle on me 😉). Remember that it will take some time to get used to the new look, so please get used to the theme and then write your remarks.
For Windows and Linux, you should run the JAR with
java -jar --add-exports java.desktop/sun.awt=ALL-UNNAMED OpenRocket.jar. This bypasses the Darklaf bug I talked about earlier.Here are some screenshots of the new dark look:







I also increased the ambient light in the 3D finished view (a request @neilweinstock also made some time ago):

Here, the UI font size is increased from 13 pt to 15 pt:

Note, Darklaf uses a different color chooser than what you're used to in the light theme. This is just because of how the library is built, nothing I can do about it really. But it still has all the same functions as the light theme color chooser.


I also fixed the issue where the UI looked horrible on some Linux builds because it would apply its own dark theme.
How it looked before:

How it looks now:
