aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/Tumbler.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/material/Tumbler.qml')
-rw-r--r--src/quickcontrols/material/Tumbler.qml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quickcontrols/material/Tumbler.qml b/src/quickcontrols/material/Tumbler.qml
index 59320cf52b..48d0c2e739 100644
--- a/src/quickcontrols/material/Tumbler.qml
+++ b/src/quickcontrols/material/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
color: control.Material.foreground
@@ -33,13 +35,11 @@ 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
}
}
-
- property real delegateHeight: control.availableHeight / control.visibleItemCount
}
}