aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/basic/Tumbler.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/basic/Tumbler.qml')
-rw-r--r--src/quickcontrols/basic/Tumbler.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quickcontrols/basic/Tumbler.qml b/src/quickcontrols/basic/Tumbler.qml
index d3d1254fea..4bd5c5fed2 100644
--- a/src/quickcontrols/basic/Tumbler.qml
+++ b/src/quickcontrols/basic/Tumbler.qml
@@ -13,6 +13,8 @@ T.Tumbler {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
+ readonly property real __delegateHeight: availableHeight / visibleItemCount
+
delegate: Text {
text: modelData
color: control.visualFocus ? control.palette.highlight : control.palette.text
@@ -35,13 +37,12 @@ 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
}
}