aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-10-15 19:39:53 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-10-19 10:39:59 +0200
commit5506dc44afbef14f27cb180afe9c388728be7e82 (patch)
tree6a898407e0e127b6490d3777b47f8f3cfbf57770 /src
parent6fecd18bc269f5faadc3575d92a902c22d25d026 (diff)
nativestyle, ScrollView: don't resize scroll bars according to padding
Depending on if you see the scroll bars as a part of the contents, the background, or neither, they should respect either padding, insets, or none of them. The styles that use transient scrollbars see them partly as a part of the contents (judging from their implementation), which means that their width and height will respect padding, but their position will not (they will always be glued to the right or the bottom side of the control). Letting width and height be affected by padding doesn't work so well with non-transient scroll bars. In that case the scroll bars should normally be "connected" at the bottom-right edge. So change the code so that the scrollbars ignore padding, and instead use the full width and height of the control. Change-Id: Ifa5a7708a51b3773a63ebdd50781eb3845be4744 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/macos/ScrollView.qml8
-rw-r--r--src/imports/controls/windows/ScrollView.qml8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/imports/controls/macos/ScrollView.qml b/src/imports/controls/macos/ScrollView.qml
index 9b695161..954c5d8a 100644
--- a/src/imports/controls/macos/ScrollView.qml
+++ b/src/imports/controls/macos/ScrollView.qml
@@ -53,8 +53,8 @@ T.ScrollView {
ScrollBar.vertical: ScrollBar {
parent: control
x: control.mirrored ? 0 : control.width - width
- y: control.topPadding
- height: control.availableHeight
+ y: 0
+ height: control.height - (control.ScrollBar.horizontal.visible ? control.ScrollBar.horizontal.height : 0)
active: control.ScrollBar.horizontal.active
NativeStyle.ScrollViewCorner {
@@ -67,9 +67,9 @@ T.ScrollView {
ScrollBar.horizontal: ScrollBar {
parent: control
- x: control.leftPadding
+ x: 0
y: control.height - height
- width: control.availableWidth
+ width: control.width - (control.ScrollBar.vertical.visible ? control.ScrollBar.vertical.width : 0)
active: control.ScrollBar.vertical.active
}
}
diff --git a/src/imports/controls/windows/ScrollView.qml b/src/imports/controls/windows/ScrollView.qml
index fe56713c..0e5ffff4 100644
--- a/src/imports/controls/windows/ScrollView.qml
+++ b/src/imports/controls/windows/ScrollView.qml
@@ -52,16 +52,16 @@ T.ScrollView {
ScrollBar.vertical: ScrollBar {
parent: control
x: control.mirrored ? 0 : control.width - width
- y: control.topPadding
- height: control.availableHeight
+ y: 0
+ height: control.height - (control.ScrollBar.horizontal.visible ? control.ScrollBar.horizontal.height : 0)
active: control.ScrollBar.horizontal.active
}
ScrollBar.horizontal: ScrollBar {
parent: control
- x: control.leftPadding
+ x: 0
y: control.height - height
- width: control.availableWidth
+ width: control.width - (control.ScrollBar.vertical.visible ? control.ScrollBar.vertical.width : 0)
active: control.ScrollBar.vertical.active
}
}