From 7166013d5f7a841b4f38d2286f5847d32f76e07f Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 2 Oct 2018 18:21:40 +0200 Subject: [PATCH] use IntelliJ laf for light themes on macOS --- .../util/src/com/intellij/util/ui/UIUtil.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 87cd06c87e5f..ec02ba085d8e 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -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; }