Slider: replaced Slider.thumbWidth with Slider.thumbSize to support non-square sized thumbs (as used in Windows 10)

This commit is contained in:
Karl Tauber
2020-11-19 16:46:46 +01:00
parent 0101171159
commit 1d3ce76b27
7 changed files with 45 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ public class FlatRangeSliderUI
extends BasicRangeSliderUI
{
protected int trackWidth;
protected int thumbWidth;
protected Dimension thumbSize;
protected int focusWidth;
protected Color trackValueColor;
@@ -105,7 +105,7 @@ public class FlatRangeSliderUI
LookAndFeel.installProperty( slider, "opaque", false );
trackWidth = UIManager.getInt( "Slider.trackWidth" );
thumbWidth = UIManager.getInt( "Slider.thumbWidth" );
thumbSize = UIManager.getDimension( "Slider.thumbSize" );
focusWidth = FlatUIUtils.getUIInt( "Slider.focusWidth", 4 );
trackValueColor = FlatUIUtils.getUIColor( "Slider.trackValueColor", "Slider.thumbColor" );
@@ -185,9 +185,7 @@ public class FlatRangeSliderUI
@Override
protected Dimension getThumbSize() {
int fw = UIScale.scale( focusWidth );
int w = UIScale.scale( thumbWidth ) + fw + fw;
return new Dimension( w, w );
return FlatSliderUI.calcThumbSize( slider, thumbSize, focusWidth );
}
@Override