From 3e8d3e2b17b5927e6f96567b5bbe501abe97eb58 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 29 Oct 2008 18:04:32 +0300 Subject: [PATCH] Nimbus-compatible getting of list selection background and foreground [r=max] --- util/src/com/intellij/util/ui/UIUtil.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/src/com/intellij/util/ui/UIUtil.java b/util/src/com/intellij/util/ui/UIUtil.java index e8bd2fa172c8..d920a27fa0ff 100644 --- a/util/src/com/intellij/util/ui/UIUtil.java +++ b/util/src/com/intellij/util/ui/UIUtil.java @@ -185,7 +185,11 @@ public class UIUtil { } public static Color getListSelectionForeground() { - return UIManager.getColor("List.selectionForeground"); + final Color color = UIManager.getColor("List.selectionForeground"); + if (color == null) { + return UIManager.getColor("List[Selected].textForeground"); // Nimbus + } + return color; } public static Color getFieldForegroundColor() { @@ -317,7 +321,11 @@ public class UIUtil { } public static Color getListSelectionBackground() { - return UIManager.getColor("List.selectionBackground"); + final Color color = UIManager.getColor("List.selectionBackground"); + if (color == null) { + return UIManager.getColor("List[Selected].textBackground"); // Nimbus + } + return color; } public static Color getTextFieldForeground() {