IDEA-150906 Mac scroll tuning: fix fade out of the overlay scroll bar

IDEA-154802 Scrollbars on OS X hide abruptly (regression)
This commit is contained in:
Sergey Malenkov
2016-04-19 16:17:46 +03:00
parent 32b01afab7
commit 246e216c7c
2 changed files with 4 additions and 1 deletions
@@ -66,9 +66,11 @@ public class JBScrollPane extends JScrollPane {
@Deprecated
public static final RegionPainter<Float> MAC_THUMB_PAINTER = new RoundThumbPainter(2, .2f, .3f, Gray.x00);
static final RegionPainter<Float> MAC_OVERLAY_THUMB_PAINTER = new RoundThumbPainter(2, 0f, .5f, Gray.x00);
@Deprecated
public static final RegionPainter<Float> MAC_THUMB_DARK_PAINTER = new RoundThumbPainter(2, .10f, .05f, Gray.xFF);
static final RegionPainter<Float> MAC_OVERLAY_THUMB_DARK_PAINTER = new RoundThumbPainter(2, 0f, .15f, Gray.xFF);
private int myViewportBorderWidth = -1;
private boolean myHasOverlayScrollbars;
@@ -100,11 +100,12 @@ final class MacScrollBarUI extends DefaultScrollBarUI {
@Override
void paintThumb(Graphics2D g, int x, int y, int width, int height, JComponent c) {
RegionPainter<Float> p = ScrollColorProducer.isDark(c) ? JBScrollPane.MAC_THUMB_DARK_PAINTER : JBScrollPane.MAC_THUMB_PAINTER;
if (c.isOpaque()) {
RegionPainter<Float> p = ScrollColorProducer.isDark(c) ? JBScrollPane.MAC_THUMB_DARK_PAINTER : JBScrollPane.MAC_THUMB_PAINTER;
paint(p, g, x, y, width, height, c, myThumbAnimator.myValue, true);
}
else if (myThumbAnimator.myValue > 0) {
RegionPainter<Float> p = ScrollColorProducer.isDark(c) ? JBScrollPane.MAC_OVERLAY_THUMB_DARK_PAINTER : JBScrollPane.MAC_OVERLAY_THUMB_PAINTER;
paint(p, g, x, y, width, height, c, myThumbAnimator.myValue, false);
}
}