mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 17:03:12 +07:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user