QmlDesigner: Add error mode to ColorLogic

Task-number: QDS-1221
Change-Id: I95009dc3700f3e308280fadaea374e7ba6dfa08b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2019-12-19 11:29:44 +01:00
committed by Henning Gründl
parent f6659f24df
commit 91b491ffb9
3 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"