From b4591256ab0ea44bf70cc6565e4ac7e0c827e389 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 24 Jul 2012 07:43:46 +0200 Subject: [PATCH] fix selection on Mac --- .../util/ui/tree/WideSelectionTreeUI.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java b/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java index 917a503c6a5a..6ab5d652a07e 100644 --- a/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java +++ b/platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java @@ -283,15 +283,17 @@ public class WideSelectionTreeUI extends BasicTreeUI { } } else { - //Color bg = tree.hasFocus() ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeUnfocusedSelectionBackground(); - //if (!selected) { - // bg = background; - //} + if (UIUtil.isUnderAquaBasedLookAndFeel()) { + Color bg = tree.hasFocus() ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeUnfocusedSelectionBackground(); + if (!selected) { + bg = background; + } - //if (/*myAlwaysPaintRowBackground || */selected) { - // rowGraphics.setColor(bg); - // rowGraphics.fillRect(xOffset, bounds.y, containerWidth, bounds.height - 1); - //} + if (myAlwaysPaintRowBackground || selected) { + rowGraphics.setColor(bg); + rowGraphics.fillRect(xOffset, bounds.y, containerWidth, bounds.height - 1); + } + } } if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { @@ -308,7 +310,7 @@ public class WideSelectionTreeUI extends BasicTreeUI { @Override public void paint(Graphics g, JComponent c) { - if (myAlwaysPaintRowBackground && myWideSelection) { + if (myAlwaysPaintRowBackground && myWideSelection && !UIUtil.isUnderAquaBasedLookAndFeel()) { paintSelectedRows(g, ((JTree)c)); } if (myWideSelection) {