Browse Source

Group system properties by "darklaf." prefix.

pull/75/head
weisj 5 years ago
parent
commit
9dc46202bc
  1. 5
      core/src/main/java/com/github/weisj/darklaf/DarkLaf.java
  2. 3
      core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java

5
core/src/main/java/com/github/weisj/darklaf/DarkLaf.java

@ -57,6 +57,7 @@ import java.util.logging.Logger;
public class DarkLaf extends BasicLookAndFeel implements PropertyChangeListener { public class DarkLaf extends BasicLookAndFeel implements PropertyChangeListener {
public static final String SYSTEM_PROPERTY_PREFIX = "darklaf.";
private static final Logger LOGGER = Logger.getLogger(DarkLaf.class.getName()); private static final Logger LOGGER = Logger.getLogger(DarkLaf.class.getName());
private static final String NAME = "Darklaf"; private static final String NAME = "Darklaf";
private final BasicLookAndFeel base; private final BasicLookAndFeel base;
@ -225,8 +226,8 @@ public class DarkLaf extends BasicLookAndFeel implements PropertyChangeListener
private void loadSystemOverwrites(final Properties uiProps, final UIDefaults defaults) { private void loadSystemOverwrites(final Properties uiProps, final UIDefaults defaults) {
Properties overwrites = PropertyLoader.loadProperties(DarkLaf.class, "overwrites", "properties/"); Properties overwrites = PropertyLoader.loadProperties(DarkLaf.class, "overwrites", "properties/");
overwrites.values().removeIf(v -> System.getProperty(v.toString()) == null); overwrites.values().removeIf(v -> System.getProperty(SYSTEM_PROPERTY_PREFIX + v.toString()) == null);
overwrites.entrySet().forEach(e -> e.setValue(System.getProperty(e.getValue().toString()))); overwrites.entrySet().forEach(e -> e.setValue(System.getProperty(SYSTEM_PROPERTY_PREFIX + e.getValue().toString())));
PropertyLoader.putProperties(overwrites, uiProps, defaults); PropertyLoader.putProperties(overwrites, uiProps, defaults);
} }

3
core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java

@ -23,6 +23,7 @@
*/ */
package com.github.weisj.darklaf.platform; package com.github.weisj.darklaf.platform;
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.decorations.CustomTitlePane; import com.github.weisj.darklaf.decorations.CustomTitlePane;
import com.github.weisj.darklaf.decorations.DecorationsProvider; import com.github.weisj.darklaf.decorations.DecorationsProvider;
@ -60,7 +61,7 @@ public final class Decorations {
public static boolean isCustomDecorationSupported() { public static boolean isCustomDecorationSupported() {
return decorationsProvider.isCustomDecorationSupported() return decorationsProvider.isCustomDecorationSupported()
&& !"false".equals(System.getProperty("darklaf.decorations")) && !"false".equals(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + "decorations"))
&& LafManager.isDecorationsEnabled() && LafManager.isDecorationsEnabled()
&& LafManager.getTheme().useCustomDecorations(); && LafManager.getTheme().useCustomDecorations();
} }

Loading…
Cancel
Save