diff options
Diffstat (limited to 'javax/swing/plaf/metal/MetalSliderUI.java')
-rw-r--r-- | javax/swing/plaf/metal/MetalSliderUI.java | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/javax/swing/plaf/metal/MetalSliderUI.java b/javax/swing/plaf/metal/MetalSliderUI.java index 0f824418c..b3e8707c9 100644 --- a/javax/swing/plaf/metal/MetalSliderUI.java +++ b/javax/swing/plaf/metal/MetalSliderUI.java @@ -352,7 +352,10 @@ public class MetalSliderUI extends BasicSliderUI */ public int getTickLength() { - return tickLength + TICK_BUFFER; + int len = tickLength + TICK_BUFFER + 1; + if (slider.getOrientation() == JSlider.VERTICAL) + len += 2; + return len; } /** @@ -406,9 +409,9 @@ public class MetalSliderUI extends BasicSliderUI // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) - g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); + g.setColor(slider.getForeground()); else - g.setColor(MetalLookAndFeel.getControlDisabled()); + g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength / 2); } @@ -425,10 +428,10 @@ public class MetalSliderUI extends BasicSliderUI // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) - g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); + g.setColor(slider.getForeground()); else - g.setColor(MetalLookAndFeel.getControlDisabled()); - g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength); + g.setColor(MetalLookAndFeel.getControlShadow()); + g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength - 1); } /** @@ -444,10 +447,10 @@ public class MetalSliderUI extends BasicSliderUI // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) - g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); + g.setColor(slider.getForeground()); else - g.setColor(MetalLookAndFeel.getControlDisabled()); - g.drawLine(TICK_BUFFER - 1, y, TICK_BUFFER - 1 + tickLength / 2, y); + g.setColor(MetalLookAndFeel.getControlShadow()); + g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength / 2, y); } /** @@ -463,10 +466,10 @@ public class MetalSliderUI extends BasicSliderUI // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) - g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); + g.setColor(slider.getForeground()); else - g.setColor(MetalLookAndFeel.getControlDisabled()); - g.drawLine(TICK_BUFFER - 1, y, TICK_BUFFER - 1 + tickLength, y); + g.setColor(MetalLookAndFeel.getControlShadow()); + g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength, y); } } |