diff options
Diffstat (limited to 'src/imports/controls/imagine/ComboBox.qml')
-rw-r--r-- | src/imports/controls/imagine/ComboBox.qml | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index fa22ab90..530fa378 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -34,26 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + background ? (background.leftPadding + background.rightPadding) : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + background ? (background.topPadding + background.bottomPadding) : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + Math.max(implicitContentHeight, + implicitIndicatorHeight) + background ? (background.topPadding + background.bottomPadding) : 0) 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 @@ -102,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: [ @@ -133,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 @@ -150,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: [ |