From 9dc46202bc22359e6422185b6b6666a2d98267de Mon Sep 17 00:00:00 2001 From: weisj Date: Tue, 10 Mar 2020 16:21:13 +0100 Subject: [PATCH] Group system properties by "darklaf." prefix. --- core/src/main/java/com/github/weisj/darklaf/DarkLaf.java | 5 +++-- .../java/com/github/weisj/darklaf/platform/Decorations.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java b/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java index 5411908b..8cd33813 100644 --- a/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java +++ b/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 static final String SYSTEM_PROPERTY_PREFIX = "darklaf."; private static final Logger LOGGER = Logger.getLogger(DarkLaf.class.getName()); private static final String NAME = "Darklaf"; private final BasicLookAndFeel base; @@ -225,8 +226,8 @@ public class DarkLaf extends BasicLookAndFeel implements PropertyChangeListener private void loadSystemOverwrites(final Properties uiProps, final UIDefaults defaults) { Properties overwrites = PropertyLoader.loadProperties(DarkLaf.class, "overwrites", "properties/"); - overwrites.values().removeIf(v -> System.getProperty(v.toString()) == null); - overwrites.entrySet().forEach(e -> e.setValue(System.getProperty(e.getValue().toString()))); + overwrites.values().removeIf(v -> System.getProperty(SYSTEM_PROPERTY_PREFIX + v.toString()) == null); + overwrites.entrySet().forEach(e -> e.setValue(System.getProperty(SYSTEM_PROPERTY_PREFIX + e.getValue().toString()))); PropertyLoader.putProperties(overwrites, uiProps, defaults); } diff --git a/core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java b/core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java index cf34a001..ab5813b5 100644 --- a/core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java +++ b/core/src/main/java/com/github/weisj/darklaf/platform/Decorations.java @@ -23,6 +23,7 @@ */ package com.github.weisj.darklaf.platform; +import com.github.weisj.darklaf.DarkLaf; import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.decorations.CustomTitlePane; import com.github.weisj.darklaf.decorations.DecorationsProvider; @@ -60,7 +61,7 @@ public final class Decorations { public static boolean isCustomDecorationSupported() { return decorationsProvider.isCustomDecorationSupported() - && !"false".equals(System.getProperty("darklaf.decorations")) + && !"false".equals(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + "decorations")) && LafManager.isDecorationsEnabled() && LafManager.getTheme().useCustomDecorations(); }