diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-10-02 10:39:21 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-10-09 11:06:06 +0200 |
commit | d3a626fbc543c6edb68b5fa206a26840c103f7c0 (patch) | |
tree | 9af9556cf579ae2c2a1b110324a8279de375be5f /src/imports | |
parent | c752fdd9ab4cb5c5e9a980ffbc858c64251d5236 (diff) |
Native style: ensure ScrollView contents doesn't go under the scrollbars
On macOS the scrollbars are not transient. The contentItem of a ScrollView
should therefore be aligned to the side of the scrollbars, rather than
to the side of the ScrollView.
Change-Id: Ie58753d61c04c979270995deb6e3b2650fa643db
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/controls/macos/ScrollView.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/windows/ScrollView.qml | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/imports/controls/macos/ScrollView.qml b/src/imports/controls/macos/ScrollView.qml index 7940bb95..aced3809 100644 --- a/src/imports/controls/macos/ScrollView.qml +++ b/src/imports/controls/macos/ScrollView.qml @@ -51,6 +51,9 @@ T.ScrollView { // (doesn't float on top), and in that case, the contents will show through them. contentItem.clip: clip && (ScrollBar.vertical.visible || ScrollBar.horizontal.visible) + rightPadding: ScrollBar.vertical.visible ? ScrollBar.vertical.width : 0 + bottomPadding: ScrollBar.horizontal.visible ? ScrollBar.horizontal.height : 0 + ScrollBar.vertical: ScrollBar { parent: control x: control.mirrored ? 0 : control.width - width diff --git a/src/imports/controls/windows/ScrollView.qml b/src/imports/controls/windows/ScrollView.qml index a6bba9de..fe56713c 100644 --- a/src/imports/controls/windows/ScrollView.qml +++ b/src/imports/controls/windows/ScrollView.qml @@ -46,6 +46,9 @@ T.ScrollView { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) + rightPadding: ScrollBar.vertical.visible ? ScrollBar.vertical.width : 0 + bottomPadding: ScrollBar.horizontal.visible ? ScrollBar.horizontal.height : 0 + ScrollBar.vertical: ScrollBar { parent: control x: control.mirrored ? 0 : control.width - width |