|
|
@ -42,14 +42,16 @@ public final class Decorations { |
|
|
|
static { |
|
|
|
static { |
|
|
|
try { |
|
|
|
try { |
|
|
|
//Extend for different platforms.
|
|
|
|
//Extend for different platforms.
|
|
|
|
if (SystemInfo.isWindows) { |
|
|
|
boolean enableDecorations = |
|
|
|
|
|
|
|
!PropertyValue.FALSE.equals(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + "decorations")); |
|
|
|
|
|
|
|
if (SystemInfo.isWindows && enableDecorations) { |
|
|
|
decorationsProvider = new WindowsDecorationsProvider(); |
|
|
|
decorationsProvider = new WindowsDecorationsProvider(); |
|
|
|
} else if (SystemInfo.isMac) { |
|
|
|
} else if (SystemInfo.isMac && enableDecorations) { |
|
|
|
decorationsProvider = new MacOSDecorationsProvider(); |
|
|
|
decorationsProvider = new MacOSDecorationsProvider(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
decorationsProvider = new DefaultDecorationsProvider(); |
|
|
|
decorationsProvider = new DefaultDecorationsProvider(); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Throwable e) { |
|
|
|
//If decorations modules are not available disable them.
|
|
|
|
//If decorations modules are not available disable them.
|
|
|
|
decorationsProvider = new DefaultDecorationsProvider(); |
|
|
|
decorationsProvider = new DefaultDecorationsProvider(); |
|
|
|
} |
|
|
|
} |
|
|
@ -62,7 +64,6 @@ public final class Decorations { |
|
|
|
|
|
|
|
|
|
|
|
public static boolean isCustomDecorationSupported() { |
|
|
|
public static boolean isCustomDecorationSupported() { |
|
|
|
return decorationsProvider.isCustomDecorationSupported() |
|
|
|
return decorationsProvider.isCustomDecorationSupported() |
|
|
|
&& !PropertyValue.FALSE.equals(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + "decorations")) |
|
|
|
|
|
|
|
&& LafManager.isDecorationsEnabled() |
|
|
|
&& LafManager.isDecorationsEnabled() |
|
|
|
&& LafManager.getTheme().useCustomDecorations(); |
|
|
|
&& LafManager.getTheme().useCustomDecorations(); |
|
|
|
} |
|
|
|
} |
|
|
|