aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/fusion/ComboBox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/fusion/ComboBox.qml')
-rw-r--r--src/quickcontrols/fusion/ComboBox.qml14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/quickcontrols/fusion/ComboBox.qml b/src/quickcontrols/fusion/ComboBox.qml
index 6caa7d3f94..55d91e65ed 100644
--- a/src/quickcontrols/fusion/ComboBox.qml
+++ b/src/quickcontrols/fusion/ComboBox.qml
@@ -1,6 +1,8 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Window
import QtQuick.Templates as T
@@ -21,8 +23,11 @@ T.ComboBox {
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
delegate: MenuItem {
+ required property var model
+ required property int index
+
width: ListView.view.width
- text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
+ text: model[control.textRole]
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
@@ -111,6 +116,7 @@ T.ComboBox {
topMargin: 6
bottomMargin: 6
padding: 1
+ palette: control.palette
contentItem: ListView {
clip: true
@@ -124,15 +130,15 @@ T.ComboBox {
}
background: Rectangle {
- color: control.popup.palette.window
- border.color: Fusion.outline(control.palette)
+ color: palette.window
+ border.color: Fusion.outline(palette)
Rectangle {
z: -1
x: 1; y: 1
width: parent.width
height: parent.height
- color: control.palette.shadow
+ color: palette.shadow
opacity: 0.2
}
}