aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine/Tumbler.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/imagine/Tumbler.qml')
-rw-r--r--src/imports/controls/imagine/Tumbler.qml30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml
index 7beb39c5..80e8eb1f 100644
--- a/src/imports/controls/imagine/Tumbler.qml
+++ b/src/imports/controls/imagine/Tumbler.qml
@@ -34,17 +34,25 @@
**
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Templates 2.4 as T
-import QtQuick.Controls 2.4
-import QtQuick.Controls.impl 2.4
-import QtQuick.Controls.Imagine 2.4
-import QtQuick.Controls.Imagine.impl 2.4
+import QtQuick 2.12
+import QtQuick.Templates 2.5 as T
+import QtQuick.Controls 2.5
+import QtQuick.Controls.impl 2.5
+import QtQuick.Controls.Imagine 2.5
+import QtQuick.Controls.Imagine.impl 2.5
T.Tumbler {
id: control
- implicitWidth: 60
- implicitHeight: 200
+
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6
+
+ topInset: background ? -background.topInset || 0 : 0
+ leftInset: background ? -background.leftInset || 0 : 0
+ rightInset: background ? -background.rightInset || 0 : 0
+ bottomInset: background ? -background.bottomInset || 0 : 0
delegate: Text {
text: modelData
@@ -56,6 +64,8 @@ T.Tumbler {
}
contentItem: TumblerView {
+ implicitWidth: 60
+ implicitHeight: 200
model: control.model
delegate: control.delegate
path: Path {
@@ -71,10 +81,6 @@ T.Tumbler {
}
background: NinePatchImage {
- x: -leftInset; y: -topInset
- width: control.width + leftInset + rightInset
- height: control.height + topInset + bottomInset
-
source: Imagine.url + "tumbler-background"
NinePatchImageSelector on source {
states: [