diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-05-02 11:23:13 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-05-09 08:26:57 +0000 |
commit | 99928905f2104ff7b7d659f7fd42ffe7d929aeb4 (patch) | |
tree | 15c124ac6b8dadc8200d7c6797aec16d4b649e8d /src/imports/controls/imagine/ComboBox.qml | |
parent | 677d9420622fcc9138606260da380d1d794b6685 (diff) |
Imagine: use background insets
All others have been updated, except GroupBox that has some strange
special handling for positioning the background.
Change-Id: Ief5a68cbeedbdc3c66b85e8d03198f70e35aac61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/imagine/ComboBox.qml')
-rw-r--r-- | src/imports/controls/imagine/ComboBox.qml | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index a75993fd..530fa378 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -53,6 +53,11 @@ T.ComboBox { leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) + 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: ItemDelegate { width: parent.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData @@ -101,10 +106,6 @@ T.ComboBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "combobox-background" NinePatchImageSelector on source { states: [ @@ -132,6 +133,11 @@ T.ComboBox { rightPadding: background.rightPadding bottomPadding: background.bottomPadding + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + palette.text: control.palette.text palette.highlight: control.palette.highlight palette.highlightedText: control.palette.highlightedText @@ -149,10 +155,6 @@ T.ComboBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.popup.width + leftInset + rightInset - height: control.popup.height + topInset + bottomInset - source: Imagine.url + "combobox-popup" NinePatchImageSelector on source { states: [ |