use IntelliJ laf for light themes on macOS

This commit is contained in:
Konstantin Bulenkov
2018-10-02 18:22:46 +02:00
parent 20175e2001
commit 7166013d5f
@@ -1645,17 +1645,18 @@ public class UIUtil {
}
public static boolean isUnderDefaultMacTheme() {
return SystemInfo.isMac && isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.macos.ui");
return SystemInfo.isMac && isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.macos.ui") && !isCustomTheme();
}
public static boolean isUnderWin10LookAndFeel() {
if (SystemInfo.isWindows && isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui")) {
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
if (lookAndFeel instanceof UserDataHolder) {
Boolean value = ((UserDataHolder)lookAndFeel).getUserData(LAF_WITH_THEME_KEY);
return value == null || !value.booleanValue();
}
return true;
return SystemInfo.isWindows && isUnderIntelliJLaF() && Registry.is("ide.intellij.laf.win10.ui") && !isCustomTheme();
}
private static boolean isCustomTheme() {
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
if (lookAndFeel instanceof UserDataHolder) {
Boolean value = ((UserDataHolder)lookAndFeel).getUserData(LAF_WITH_THEME_KEY);
return value != null && value.booleanValue();
}
return false;
}