forked from qt-creator/qt-creator
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:
committed by
Henning Gründl
parent
f6659f24df
commit
91b491ffb9
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user