diff options
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r-- | src/controls/ComboBox.qml | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index db39f579..d7a3d3d1 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -323,8 +323,9 @@ Control { renderType: Text.NativeRendering selectByMouse: true - selectionColor: syspal.highlight - selectedTextColor: syspal.highlightedText + color: __style.__syspal.text + selectionColor: __style.__syspal.highlight + selectedTextColor: __style.__syspal.highlightedText onAccepted: { var idx = input.find(editText) if (idx > -1) { @@ -340,8 +341,6 @@ Control { comboBox.accepted(); } - SystemPalette { id: syspal } - property bool blockUpdate: false property string prevText @@ -432,7 +431,7 @@ Control { property ExclusiveGroup eg: ExclusiveGroup { id: eg } - property bool __modelIsArray: popupItems.model ? popupItems.model.constructor === Array : false + property bool modelIsArray: false Instantiator { id: popupItems @@ -440,6 +439,7 @@ Control { property bool updatingModel: false onModelChanged: { + popup.modelIsArray = !!model ? model.constructor === Array : false if (active) { if (updatingModel && popup.__selectedIndex === 0) { // We still want to update the currentText @@ -449,12 +449,13 @@ Control { popup.__selectedIndex = 0 } } + popup.resolveTextValue(comboBox.textRole) } MenuItem { text: popup.textRole === '' ? modelData : - ((popup.__modelIsArray ? modelData[popup.textRole] : model[popup.textRole]) || '') + ((popup.modelIsArray ? modelData[popup.textRole] : model[popup.textRole]) || '') onTriggered: { if (index !== currentIndex) activated(index) @@ -479,7 +480,7 @@ Control { } var get = model['get']; - if (!get && popup.__modelIsArray) { + if (!get && popup.modelIsArray && !!model[0]) { if (model[0].constructor !== String && model[0].constructor !== Number) get = function(i) { return model[i]; } } |