diff --git a/install4j/23.09/openrocket-23.09.install4j b/install4j/23.09/openrocket-23.09.install4j index 57a648c3c..092c3555c 100644 --- a/install4j/23.09/openrocket-23.09.install4j +++ b/install4j/23.09/openrocket-23.09.install4j @@ -1,5 +1,5 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/swing/src/main/java/info/openrocket/swing/gui/theme/UITheme.java b/swing/src/main/java/info/openrocket/swing/gui/theme/UITheme.java index e94ba1e35..db7536c4e 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/theme/UITheme.java +++ b/swing/src/main/java/info/openrocket/swing/gui/theme/UITheme.java @@ -40,6 +40,7 @@ public class UITheme { // TODO: replace a bunch of this with the FlatLaf properties files, see https://www.formdev.com/flatlaf/properties-files + // For FlatLaf theme properties, check out swing/src/main/resources/themes public interface Theme { void applyTheme(); @@ -1814,9 +1815,6 @@ public class UITheme { private static void postApplyTheme(Theme theme) { final SwingPreferences prefs = (SwingPreferences) Application.getPreferences(); - // TODO: For some reason, FlatLaf does not take the correct values from the properties file - UIManager.put("OR.ScrollPane.borderColor", theme.getBorderColor()); - // Clear custom default font when switching to non-FlatLaf LaF if (!(UIManager.getLookAndFeel() instanceof FlatLaf)) { UIManager.put("defaultFont", null); diff --git a/swing/src/main/java/info/openrocket/swing/startup/OSXSetup.java b/swing/src/main/java/info/openrocket/swing/startup/OSXSetup.java index f3d27d316..67c5b8f1b 100644 --- a/swing/src/main/java/info/openrocket/swing/startup/OSXSetup.java +++ b/swing/src/main/java/info/openrocket/swing/startup/OSXSetup.java @@ -89,12 +89,7 @@ final class OSXSetup { } log.debug("Setting up OSX UI Elements"); try { - // Put the menu bar at the top of the screen - System.setProperty("apple.laf.useScreenMenuBar", "true"); - // Fix window title bar color - System.setProperty("apple.awt.application.appearance", "system"); - // Set the name in the menu - System.setProperty("com.apple.mrj.application.apple.menu.about.name", APP_NAME); + setupOSXProperties(); // This line must come AFTER the above properties are set, otherwise // the name will not appear @@ -125,6 +120,20 @@ final class OSXSetup { } } + public static void setupOSXProperties() { + if (SystemInfo.getPlatform() != Platform.MAC_OS) { + log.warn("Attempting to set up OSX properties on non-MAC_OS"); + return; + } + + // Put the menu bar at the top of the screen + System.setProperty("apple.laf.useScreenMenuBar", "true"); + // Fix window title bar color + System.setProperty("apple.awt.application.appearance", "system"); + // Set the name in the menu + System.setProperty("com.apple.mrj.application.apple.menu.about.name", APP_NAME); + } + /** * Sets up the open file handler, which handles file association on macOS. */ diff --git a/swing/src/main/java/info/openrocket/swing/startup/OpenRocket.java b/swing/src/main/java/info/openrocket/swing/startup/OpenRocket.java index 83617f1b6..992797d75 100644 --- a/swing/src/main/java/info/openrocket/swing/startup/OpenRocket.java +++ b/swing/src/main/java/info/openrocket/swing/startup/OpenRocket.java @@ -28,6 +28,9 @@ public class OpenRocket { private static final String STARTUP_CLASS = "info.openrocket.swing.startup.SwingStartup"; public static void main(String[] args) { + // Set OSX-specific properties + OSXSetup.setupOSXProperties(); + // This property works around some fundamental bugs in TimSort in the java library which has had known issues // since it was introduced in JDK 1.7. In OpenRocket it manifests when you sort the motors in the motor chooser dialog // by designation. diff --git a/swing/src/main/resources/themes/FlatDarculaLaf.properties b/swing/src/main/resources/themes/FlatDarculaLaf.properties index e5c83ede0..795dcfdc1 100644 --- a/swing/src/main/resources/themes/FlatDarculaLaf.properties +++ b/swing/src/main/resources/themes/FlatDarculaLaf.properties @@ -6,4 +6,4 @@ Slider.trackColor = #a3a3a3cc SplitPaneDivider.hoverColor = lighten(@background, 5%) # Custom OpenRocket keys -OR.ScrollPane.borderColor = #a3a3a3cc +OR.ScrollPane.borderColor = #8a8a8acc diff --git a/swing/src/main/resources/themes/FlatLaf.properties b/swing/src/main/resources/themes/FlatLaf.properties index 0187ded38..b8a022a04 100644 --- a/swing/src/main/resources/themes/FlatLaf.properties +++ b/swing/src/main/resources/themes/FlatLaf.properties @@ -18,8 +18,9 @@ Tree.rendererMargins = 2, 0, 3, 0 TextArea.margin = 10, 10, 10, 10 ScrollPane.smoothScrolling = true ScrollPane.border = info.openrocket.swing.gui.theme.ORScrollPaneBorder +TextField.border = info.openrocket.swing.gui.theme.ORScrollPaneBorder Slider.trackWidth = 3 # Custom OpenRocket keys -OR.ScrollPane.borderColor = #000000 \ No newline at end of file +OR.ScrollPane.borderColor = #969696 \ No newline at end of file diff --git a/swing/src/main/resources/themes/IntelliJTheme$ThemeLaf.properties b/swing/src/main/resources/themes/IntelliJTheme$ThemeLaf.properties index 31087bc39..ad25db5d9 100644 --- a/swing/src/main/resources/themes/IntelliJTheme$ThemeLaf.properties +++ b/swing/src/main/resources/themes/IntelliJTheme$ThemeLaf.properties @@ -6,5 +6,4 @@ [One_Dark]SplitPaneDivider.hoverColor = lighten(@background, 5%) # Custom OpenRocket keys -#[One_Dark]OR.ScrollPane.borderColor = #616365 -[One_Dark]ScrollPane.borderColor = #FF0000 +[One_Dark]OR.ScrollPane.borderColor = #6e7275