Skip to content

Commit

Permalink
Fix scrollbar minimumsize for large views
Browse files Browse the repository at this point in the history
As height becomes extreme, switch to fixed size
  • Loading branch information
stofte committed Jan 3, 2019
1 parent b622e92 commit 906d0a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/qml/components/CustomScrollBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ScrollBar {
property real scrollContentSize: 0
property real pageScrollOverlapSize: 35
property real pageScrollStepSize: (scrollContainerSize - pageScrollOverlapSize) / scrollContentSize
property real scrollBarMinimumSize: 18
// scrollTarget is assumed to point to the content being scrolled,
// so we can detect when it changes, to reset the scroll position.
property variant scrollTarget
Expand All @@ -26,6 +27,7 @@ ScrollBar {
rightPadding: isVertival ? 2 : height
topPadding: isVertival ? width : 2
bottomPadding: isVertival ? width : 2
minimumSize: Math.min(0.5, scrollBarMinimumSize / (height))
contentItem: Rectangle {
color: !parent.enabled ? Style.window :
parent.pressed ? Style.controlActive : Style.control
Expand Down

0 comments on commit 906d0a8

Please sign in to comment.