aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/universal/ItemDelegate.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-05 13:33:08 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-06 13:16:14 +0000
commit54efc8f33d9c37e8912f5755af588817192a869d (patch)
tree31bc7b81e95ffccb0e2948f44898941ca49f46c1 /src/imports/controls/universal/ItemDelegate.qml
parent802f6b747f4cd76bda4395b6bc06dec81da1110c (diff)
ItemDelegate: migrate from label to contentItem
Change-Id: I928192b1b5d31e077032cba31f1bde3bf35491f3 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/universal/ItemDelegate.qml')
-rw-r--r--src/imports/controls/universal/ItemDelegate.qml20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml
index d2c9a4f3..406bdb42 100644
--- a/src/imports/controls/universal/ItemDelegate.qml
+++ b/src/imports/controls/universal/ItemDelegate.qml
@@ -42,13 +42,11 @@ T.ItemDelegate {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
- (label ? label.implicitWidth : 0) +
- (indicator ? indicator.implicitWidth : 0) +
- (label && indicator ? spacing : 0) + leftPadding + rightPadding)
+ contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
- Math.max(label ? label.implicitHeight : 0,
+ Math.max(contentItem.implicitHeight,
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
- baselineOffset: label ? label.y + label.baselineOffset : 0
+ baselineOffset: contentItem.y + contentItem.baselineOffset
spacing: 12
@@ -67,12 +65,10 @@ T.ItemDelegate {
}
//! [indicator]
- //! [label]
- label: Text {
- x: control.mirrored || !control.checkable ? control.leftPadding : (indicator.x + indicator.width + control.spacing)
- y: control.topPadding
- width: control.availableWidth - (control.checkable ? indicator.width + control.spacing : 0)
- height: control.availableHeight
+ //! [contentItem]
+ contentItem: Text {
+ leftPadding: control.checkable && !control.mirrored ? control.indicator.width + control.spacing : 0
+ rightPadding: control.checkable && control.mirrored ? control.indicator.width + control.spacing : 0
text: control.text
font: control.font
@@ -84,7 +80,7 @@ T.ItemDelegate {
color: !control.enabled ? control.Universal.baseLowColor : control.Universal.baseHighColor
}
- //! [label]
+ //! [contentItem]
//! [background]
background: Rectangle {