From 929f12eefc65fbf24e9bbb724ed516b154312d3c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 14 Apr 2014 12:11:51 +0200 Subject: QmlDesigner.PropertyEditor: Fixing colouring for FontComboBox Task-number: QTCREATORBUG-12027 Change-Id: Ic5ad0e16a7d60dacc89fa4c226e30a40a45be9db Reviewed-by: Robert Loehning Reviewed-by: Marco Bubke --- .../HelperWidgets/FontComboBox.qml | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'share/qtcreator/qmldesigner/propertyEditorQmlSources') diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/FontComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/FontComboBox.qml index 9c15b039b3..413fe2a9e3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/FontComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/FontComboBox.qml @@ -47,7 +47,9 @@ Controls.ComboBox { id: comboBox property variant backendValue - property color textColor: "white" + property color textColor: colorLogic.textColor + + onTextColorChanged: setColor() editable: true model: ["Arial", "Times New Roman", "Courier", "Verdana", "Tahoma"] @@ -60,9 +62,13 @@ Controls.ComboBox { textColor: comboBox.textColor } - property string textValue: backendValue.value - onTextValueChanged: { - comboBox.editText = textValue + ColorLogic { + id: colorLogic + backendValue: comboBox.backendValue + property string textValue: backendValue.value + onTextValueChanged: { + comboBox.editText = textValue + } } Layout.fillWidth: true @@ -85,7 +91,6 @@ Controls.ComboBox { Component.onCompleted: { //Hack to style the text input for (var i = 0; i < comboBox.children.length; i++) { - print(comboBox.children[i]) if (comboBox.children[i].text !== undefined) { comboBox.children[i].color = comboBox.textColor comboBox.children[i].anchors.rightMargin = 34 @@ -93,5 +98,13 @@ Controls.ComboBox { } } } + function setColor() { + //Hack to style the text input + for (var i = 0; i < comboBox.children.length; i++) { + if (comboBox.children[i].text !== undefined) { + comboBox.children[i].color = comboBox.textColor + } + } + } } -- cgit v1.2.1