From 80d8b7f994a74f0aa9b6bcda60fbfe7e55cb725a Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Tue, 7 Oct 2014 17:11:33 +0200 Subject: [PATCH] IDEA-129372 Draw outline of the auto-hideable scrollbar in the editor's right gutter --- .../intellij/util/ui/ButtonlessScrollBarUI.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java b/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java index b11ca7f3222f..093407542c74 100644 --- a/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java +++ b/platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java @@ -569,17 +569,23 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI { } private void paintMacThumb(Graphics g, Rectangle thumbBounds) { - if (myMacScrollbarHidden) return; - thumbBounds = getMacScrollBarBounds(thumbBounds, true); Graphics2D g2d = (Graphics2D)g; RenderingHints oldHints = g2d.getRenderingHints(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.setColor(adjustColor(new JBColor(Gray._0, Gray._128))); - + JBColor baseColor = new JBColor(Gray._0, Gray._128); int arc = Math.min(thumbBounds.width, thumbBounds.height); - g2d.fillRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc); + + if (alwaysShowTrack()) { + g2d.setColor(new Color(baseColor.getRed(), baseColor.getGreen(), baseColor.getBlue(), UIUtil.isUnderDarcula() ? 100 : 40)); + g2d.drawRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc); + } + + if (!myMacScrollbarHidden) { + g2d.setColor(adjustColor(baseColor)); + g2d.fillRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc); + } g2d.setRenderingHints(oldHints); }