diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-05 12:35:34 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-02-06 13:16:09 +0000 |
commit | 7280a42c2591609d574ad407189a491f06f04f9d (patch) | |
tree | f94cbcab0357c5ba7b0716ebcafca1df984f18cc /src/imports/controls/material/CheckBox.qml | |
parent | 51d8385e7eba662d63b73e2c9fa9b01ddc12cc51 (diff) |
CheckBox: migrate from label to contentItem
Change-Id: Ie35fc6a9a5424c6f002480fc461b7cd5fe84753b
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/material/CheckBox.qml')
-rw-r--r-- | src/imports/controls/material/CheckBox.qml | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index 88a8a3fc..abaf571d 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -43,13 +43,11 @@ T.CheckBox { 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: 8 topPadding: 14 @@ -144,12 +142,10 @@ T.CheckBox { } //! [indicator] - //! [label] - label: Text { - x: control.mirrored ? control.leftPadding : (indicator.x + indicator.width + control.spacing) - y: control.topPadding - width: control.availableWidth - indicator.width - control.spacing - height: control.availableHeight + //! [contentItem] + contentItem: Text { + leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0 + rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0 text: control.text font: control.font @@ -159,5 +155,5 @@ T.CheckBox { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } - //! [label] + //! [contentItem] } |