ScrollBar: increased minimum thumb size on macOS and Linux to 18px and on Windows to 10px; also include ScrollBar.thumbInsets in minimum size calculation (issue #131)

This commit is contained in:
Karl Tauber
2020-07-27 14:41:01 +02:00
parent 5a9e620c17
commit a8423f7741
9 changed files with 26 additions and 8 deletions

View File

@@ -6,10 +6,12 @@ FlatLaf Change Log
- Animated theme change (see [FlatLaf Extras](flatlaf-extras)).
- Custom window decorations: Fixed maximized window bounds when programmatically
maximizing window. E.g. restoring window state at startup. (issue #129)
- InternalFrame: Title pane height was too small when iconify, maximize and close
buttons are hidden. (issue #132)
- InternalFrame: Title pane height was too small when iconify, maximize and
close buttons are hidden. (issue #132)
- ScrollPane: Enable/disable smooth scrolling per component if client property
"JScrollPane.smoothScrolling" is set to a `Boolean` on `JScrollPane`.
- ScrollBar: Increased minimum thumb size on macOS and Linux from 8 to 18
pixels. On Windows, it is now 10 pixels. (issue #131)
## 0.38

View File

@@ -284,12 +284,12 @@ public class FlatScrollBarUI
@Override
protected Dimension getMinimumThumbSize() {
return UIScale.scale( super.getMinimumThumbSize() );
return UIScale.scale( FlatUIUtils.addInsets( super.getMinimumThumbSize(), thumbInsets ) );
}
@Override
protected Dimension getMaximumThumbSize() {
return UIScale.scale( super.getMaximumThumbSize() );
return UIScale.scale( FlatUIUtils.addInsets( super.getMaximumThumbSize(), thumbInsets ) );
}
//---- class ScrollBarHoverListener ---------------------------------------

View File

@@ -438,6 +438,8 @@ RootPane.honorDialogMinimumSizeOnResize=true
#---- ScrollBar ----
ScrollBar.width=10
ScrollBar.minimumThumbSize=10,10
ScrollBar.maximumThumbSize=100000,100000
ScrollBar.trackInsets=0,0,0,0
ScrollBar.thumbInsets=0,0,0,0
ScrollBar.trackArc=0
@@ -450,10 +452,12 @@ ScrollBar.buttonArrowColor=$ComboBox.buttonArrowColor
ScrollBar.buttonDisabledArrowColor=$ComboBox.buttonDisabledArrowColor
ScrollBar.allowsAbsolutePositioning=true
[mac]ScrollBar.minimumThumbSize=18,18
[mac]ScrollBar.thumbInsets=2,2,2,2
[mac]ScrollBar.thumbArc=999
[mac]ScrollBar.hoverThumbWithTrack=true
[linux]ScrollBar.minimumThumbSize=18,18
[linux]ScrollBar.thumbInsets=2,2,2,2
[linux]ScrollBar.thumbArc=999

View File

@@ -7,6 +7,9 @@
- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]
+ ProgressBar.font [active] Cantarell plain 13 javax.swing.plaf.FontUIResource [UI]
- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
+ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI]
- ScrollBar.thumbArc 0
+ ScrollBar.thumbArc 999

View File

@@ -22,6 +22,9 @@
- ScrollBar.hoverThumbWithTrack false
+ ScrollBar.hoverThumbWithTrack true
- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
+ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI]
- ScrollBar.thumbArc 0
+ ScrollBar.thumbArc 999

View File

@@ -783,8 +783,8 @@ ScrollBar.hoverButtonBackground #484c4e com.formdev.flatlaf.util.DerivedColor
ScrollBar.hoverThumbColor #6e767a com.formdev.flatlaf.util.DerivedColor [UI] lighten(10%)
ScrollBar.hoverThumbWithTrack false
ScrollBar.hoverTrackColor #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(4%)
ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.maximumThumbSize 100000,100000 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.pressedButtonBackground #54595c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10%)
ScrollBar.pressedThumbColor #7a8387 com.formdev.flatlaf.util.DerivedColor [UI] lighten(15%)
ScrollBar.pressedThumbWithTrack false

View File

@@ -7,6 +7,9 @@
- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]
+ ProgressBar.font [active] Cantarell plain 13 javax.swing.plaf.FontUIResource [UI]
- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
+ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI]
- ScrollBar.thumbArc 0
+ ScrollBar.thumbArc 999

View File

@@ -22,6 +22,9 @@
- ScrollBar.hoverThumbWithTrack false
+ ScrollBar.hoverThumbWithTrack true
- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
+ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI]
- ScrollBar.thumbArc 0
+ ScrollBar.thumbArc 999

View File

@@ -788,8 +788,8 @@ ScrollBar.hoverButtonBackground #e5e5e5 com.formdev.flatlaf.util.DerivedColor
ScrollBar.hoverThumbColor #c3c3c3 com.formdev.flatlaf.util.DerivedColor [UI] darken(10%)
ScrollBar.hoverThumbWithTrack false
ScrollBar.hoverTrackColor #ededed com.formdev.flatlaf.util.DerivedColor [UI] darken(3%)
ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.maximumThumbSize 100000,100000 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI]
ScrollBar.pressedButtonBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(10%)
ScrollBar.pressedThumbColor #a9a9a9 com.formdev.flatlaf.util.DerivedColor [UI] darken(20%)
ScrollBar.pressedThumbWithTrack false