From cecd7bbf6d9cfd79f5a672e8abbf3653afcd2c9c Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Fri, 26 Feb 2010 15:20:34 +0100 Subject: [PATCH] QmlDesigner.PropertyEditor: Color coding for LineEdit --- .../propertyeditor/Qt/ColorGroupBox.qml | 1 + .../qmldesigner/propertyeditor/Qt/LineEdit.qml | 11 +++++++++++ .../propertyeditor/Qt/StandardTextGroupBox.qml | 18 +++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/ColorGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/ColorGroupBox.qml index d06f63ebfc9..475b7f6f3b6 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/ColorGroupBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/ColorGroupBox.qml @@ -33,6 +33,7 @@ QExtGroupBox { LineEdit { backendValue: colorGroupBox.backendColor + baseStateFlag: isBaseState } ColorButton { diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml index 59cd6227850..6fd6514e70b 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml @@ -7,9 +7,19 @@ QWidget { property var backendValue property alias enabled: lineEdit.enabled property var baseStateFlag + property alias text: lineEditWidget.text minimumHeight: 24; + onBaseStateFlagChanged: { + evaluate(); + } + + property var isEnabled: comboBox.enabled + onIsEnabledChanged: { + evaluate(); + } + Script { function evaluate() { if (!enabled) { @@ -42,6 +52,7 @@ QWidget { onTextEdited: { backendValue.value = text + evaluate(); } onFocusChanged: { diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml index cd1f4f986b7..a6cdc5df4c4 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/StandardTextGroupBox.qml @@ -62,9 +62,9 @@ GroupBox { } } } - - ColorLabel { - text: " Color" + + ColorLabel { + text: " Color" } ColorGroupBox { @@ -73,18 +73,18 @@ GroupBox { backendColor: backendValues.color } - - ColorLabel { - visible: showStyleColor - text: " Style Color" + + ColorLabel { + visible: showStyleColor + text: " Style Color" } ColorGroupBox { - visible: showStyleColor + visible: showStyleColor finished: finishedNotify backendColor: backendValues.styleColor || null } - + } }