Add command line option to change theme

This is really just a failsafe in case the dark theme cause OR to crash
This commit is contained in:
SiboVG 2023-07-29 03:42:31 +02:00
parent 86a71d5375
commit 12265308ec

View File

@ -29,6 +29,7 @@ import net.sf.openrocket.gui.main.Splash;
import net.sf.openrocket.gui.main.SwingExceptionHandler;
import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.gui.util.SwingPreferences;
import net.sf.openrocket.gui.util.UITheme;
import net.sf.openrocket.logging.LoggingSystemSetup;
import net.sf.openrocket.logging.PrintStreamToSLF4J;
import net.sf.openrocket.plugin.PluginModule;
@ -200,6 +201,12 @@ public class SwingStartup {
// Set the look-and-feel
log.info("Setting LAF");
String cmdLAF = System.getProperty("openrocket.laf");
if (cmdLAF != null) {
log.info("Setting cmd line LAF '{}'", cmdLAF);
Preferences prefs = Application.getPreferences();
prefs.setUITheme(UITheme.Themes.valueOf(cmdLAF));
}
GUIUtil.applyLAF();
// Set tooltip delay time. Tooltips are used in MotorChooserDialog extensively.