aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/universal/Tumbler.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/universal/Tumbler.qml')
-rw-r--r--src/quickcontrols/universal/Tumbler.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quickcontrols/universal/Tumbler.qml b/src/quickcontrols/universal/Tumbler.qml
index 03b5fcca63..e6d7da6e2c 100644
--- a/src/quickcontrols/universal/Tumbler.qml
+++ b/src/quickcontrols/universal/Tumbler.qml
@@ -14,6 +14,8 @@ T.Tumbler {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
+ readonly property real __delegateHeight: availableHeight / visibleItemCount
+
delegate: Text {
text: modelData
font: control.font
@@ -33,10 +35,10 @@ T.Tumbler {
delegate: control.delegate
path: Path {
startX: control.contentItem.width / 2
- startY: -control.contentItem.delegateHeight / 2
+ startY: -control.__delegateHeight / 2
PathLine {
x: control.contentItem.width / 2
- y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2
+ y: (control.visibleItemCount + 1) * control.__delegateHeight - control.__delegateHeight / 2
}
}