mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Do not paint scroll track border under the leading and trailing components
This commit is contained in:
@@ -272,32 +272,6 @@ class DefaultScrollBarUI extends ScrollBarUI {
|
||||
}
|
||||
Rectangle bounds = new Rectangle(c.getWidth(), c.getHeight());
|
||||
JBInsets.removeFrom(bounds, c.getInsets());
|
||||
if (parent instanceof JScrollPane) {
|
||||
Color foreground = c.getForeground();
|
||||
if (foreground != null && !foreground.equals(background) && isBorderNeeded(c)) {
|
||||
g.setColor(foreground);
|
||||
switch (alignment) {
|
||||
case TOP:
|
||||
bounds.height--;
|
||||
g.drawLine(bounds.x, bounds.y + bounds.height, bounds.x + bounds.width, bounds.y + bounds.height);
|
||||
break;
|
||||
case LEFT:
|
||||
bounds.width--;
|
||||
g.drawLine(bounds.x + bounds.width, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height);
|
||||
break;
|
||||
case RIGHT:
|
||||
g.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height);
|
||||
bounds.width--;
|
||||
bounds.x++;
|
||||
break;
|
||||
case BOTTOM:
|
||||
g.drawLine(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y);
|
||||
bounds.height--;
|
||||
bounds.y++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// process an area before the track
|
||||
Component leading = UIUtil.getClientProperty(c, LEADING);
|
||||
if (leading != null) {
|
||||
@@ -328,6 +302,32 @@ class DefaultScrollBarUI extends ScrollBarUI {
|
||||
trailing.setBounds(bounds.x + bounds.width, bounds.y, size, bounds.height);
|
||||
}
|
||||
}
|
||||
if (parent instanceof JScrollPane) {
|
||||
Color foreground = c.getForeground();
|
||||
if (foreground != null && !foreground.equals(background) && isBorderNeeded(c)) {
|
||||
g.setColor(foreground);
|
||||
switch (alignment) {
|
||||
case TOP:
|
||||
bounds.height--;
|
||||
g.drawLine(bounds.x, bounds.y + bounds.height, bounds.x + bounds.width, bounds.y + bounds.height);
|
||||
break;
|
||||
case LEFT:
|
||||
bounds.width--;
|
||||
g.drawLine(bounds.x + bounds.width, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height);
|
||||
break;
|
||||
case RIGHT:
|
||||
g.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height);
|
||||
bounds.width--;
|
||||
bounds.x++;
|
||||
break;
|
||||
case BOTTOM:
|
||||
g.drawLine(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y);
|
||||
bounds.height--;
|
||||
bounds.y++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isOpaque(c) && myTrackAnimator.myValue > 0) {
|
||||
paintTrack((Graphics2D)g, bounds.x, bounds.y, bounds.width, bounds.height, c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user