summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2019-12-19 11:29:44 +0100
committerHenning Gründl <henning.gruendl@qt.io>2020-01-06 13:25:45 +0000
commit91b491ffb9bb59f8efd6076b64e0e478c12cef71 (patch)
tree140d83f4413a7dfbfdf83be18d1e01b43cce15bf
parentf6659f24dfde7d1378bc22a83ad6b19e20612926 (diff)
downloadqt-creator-91b491ffb9bb59f8efd6076b64e0e478c12cef71.tar.gz
QmlDesigner: Add error mode to ColorLogic
Task-number: QDS-1221 Change-Id: I95009dc3700f3e308280fadaea374e7ba6dfa08b Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml10
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml2
3 files changed, 14 insertions, 2 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml
index 9c20009779..a39d7fd788 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml
@@ -36,20 +36,28 @@ QtObject {
property bool isInModel: backendValue.isInModel;
property bool isInSubState: backendValue.isInSubState;
property bool highlight: textColor === __changedTextColor
+ property bool errorState: false
- property color __defaultTextColor: StudioTheme.Values.themeTextColor
+ readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor
readonly property color __changedTextColor: StudioTheme.Values.themeInteraction
+ readonly property color __errorTextColor: StudioTheme.Values.themeErrorColor
onBackendValueChanged: evaluate()
onValueFromBackendChanged: evaluate()
onBaseStateFlagChanged: evaluate()
onIsInModelChanged: evaluate()
onIsInSubStateChanged: evaluate()
+ onErrorStateChanged: evaluate()
function evaluate() {
if (innerObject.backendValue === undefined)
return
+ if (innerObject.errorState) {
+ innerObject.textColor = __errorTextColor
+ return
+ }
+
if (innerObject.baseStateFlag) {
if (innerObject.backendValue.isInModel)
innerObject.textColor = __changedTextColor
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml
index 2332759056..eb6fc60476 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml
@@ -33,7 +33,7 @@ StudioControls.ComboBox {
property variant backendValue
- labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor
+ labelColor: edit && !colorLogic.errorState ? StudioTheme.Values.themeTextColor : colorLogic.textColor
property string scope: "Qt"
property bool useInteger: false
@@ -48,6 +48,8 @@ StudioControls.ComboBox {
property bool showExtendedFunctionButton: true
+ property alias colorLogic: colorLogic
+
ExtendedFunctionLogic {
id: extFuncLogic
backendValue: comboBox.backendValue
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
index 32136421a4..ff10e1e79f 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
@@ -108,6 +108,8 @@ QtObject {
property string themeSliderInactiveTrackFocus: "#606060"
property string themeSliderHandleFocus: values.themeInteraction
+ property string themeErrorColor: "#df3a3a"
+
// NEW NEW NEW NEW NEW
property string themeControlBackgroundDisabled: "#363636"
property string themeControlOutlineDisabled: "#404040"