diff --git a/platform/lang-impl/src/com/intellij/slicer/SlicePanel.java b/platform/lang-impl/src/com/intellij/slicer/SlicePanel.java index f1bfad2a1e5f..87937a374fdb 100644 --- a/platform/lang-impl/src/com/intellij/slicer/SlicePanel.java +++ b/platform/lang-impl/src/com/intellij/slicer/SlicePanel.java @@ -143,7 +143,7 @@ public abstract class SlicePanel extends JPanel implements TypeSafeDataProvider, add(createToolbar().getComponent(), BorderLayout.WEST); - myTree.getParent().setBackground(UIManager.getColor("Tree.background")); + myTree.getParent().setBackground(UIUtil.getTreeBackground()); revalidate(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java index 68c377c3a671..7953a2f3b4c0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java @@ -518,7 +518,7 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis private static JLabel createInitializingLabel() { JLabel label = new JLabel("Initializing...", SwingConstants.CENTER); label.setOpaque(true); - final Color treeBg = UIManager.getColor("Tree.background"); + final Color treeBg = UIUtil.getTreeBackground(); label.setBackground(ColorUtil.toAlpha(treeBg, 180)); final Color treeFg = UIUtil.getTreeForeground(); label.setForeground(ColorUtil.toAlpha(treeFg, 180)); diff --git a/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java b/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java index ee8e04785065..910f0ed19dd8 100644 --- a/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java +++ b/platform/platform-impl/src/com/intellij/ui/BalloonImpl.java @@ -1695,7 +1695,7 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui, ScreenAreaConsumer { Wrapper contentWrapper = new Wrapper(content); if (myTitle != null) { myTitleLabel = new JLabel(myTitle, SwingConstants.CENTER); - myTitleLabel.setForeground(UIManager.getColor("List.background")); + myTitleLabel.setForeground(UIUtil.getListBackground()); myTitleLabel.setBorder(JBUI.Borders.empty(0, 4)); myContent.add(myTitleLabel, BorderLayout.NORTH); contentWrapper.setBorder(JBUI.Borders.empty(1)); diff --git a/platform/util/ui/src/com/intellij/util/ui/UIUtil.java b/platform/util/ui/src/com/intellij/util/ui/UIUtil.java index 8daf9f21357a..cd9e967fbab6 100644 --- a/platform/util/ui/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/ui/src/com/intellij/util/ui/UIUtil.java @@ -3649,6 +3649,18 @@ public final class UIUtil extends StartupUiUtil { } + private static final Color BACKGROUND = new JBColor(0xFFFFFF, 0x3C3F41); + private static final Color LIST_BACKGROUND = JBColor.namedColor("List.background", BACKGROUND); + private static final Color TREE_BACKGROUND = JBColor.namedColor("Tree.background", BACKGROUND); + private static final Color TABLE_BACKGROUND = JBColor.namedColor("Table.background", BACKGROUND); + + private static final class FocusedSelection { + private static final Color BACKGROUND = new JBColor(0x3875D6, 0x2F65CA); + private static final Color LIST_BACKGROUND = JBColor.namedColor("List.selectionBackground", BACKGROUND); + private static final Color TREE_BACKGROUND = JBColor.namedColor("Tree.selectionBackground", BACKGROUND); + private static final Color TABLE_BACKGROUND = JBColor.namedColor("Table.selectionBackground", BACKGROUND); + } + private static final class UnfocusedSelection { private static final Color BACKGROUND = new JBColor(0xD4D4D4, 0x0D293E); private static final Color LIST_BACKGROUND = JBColor.namedColor("List.selectionInactiveBackground", BACKGROUND); @@ -3667,8 +3679,6 @@ public final class UIUtil extends StartupUiUtil { // background - private static final Color LIST_BACKGROUND = JBColor.namedColor("List.background", new JBColor(0xffffff, 0x3c3f41)); - @NotNull public static Color getListBackground() { return LIST_BACKGROUND; @@ -3773,13 +3783,12 @@ public final class UIUtil extends StartupUiUtil { @NotNull public static Color getTreeBackground() { - return UIManager.getColor("Tree.background"); + return TREE_BACKGROUND; } @NotNull public static Color getTreeSelectionBackground(boolean focused) { - if (!focused) return UnfocusedSelection.TREE_BACKGROUND; - return UIManager.getColor("Tree.selectionBackground"); + return focused ? FocusedSelection.TREE_BACKGROUND : UnfocusedSelection.TREE_BACKGROUND; } @NotNull @@ -3834,13 +3843,12 @@ public final class UIUtil extends StartupUiUtil { @NotNull public static Color getTableBackground() { - return UIManager.getColor("Table.background"); + return TABLE_BACKGROUND; } @NotNull public static Color getTableSelectionBackground(boolean focused) { - if (!focused) return UnfocusedSelection.TABLE_BACKGROUND; - return UIManager.getColor("Table.selectionBackground"); + return focused ? FocusedSelection.TABLE_BACKGROUND : UnfocusedSelection.TABLE_BACKGROUND; } @NotNull