summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2013-10-23 14:37:43 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2013-10-23 14:38:29 +0200
commit60710f6c05117340b95c7e7c5a12f78491893af3 (patch)
tree9e40e0ab927b05b0949755c177ba2d235a8003e4 /share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
parent8b2682b2570c3b15889c26522c9081949cd4f24c (diff)
downloadqt-creator-60710f6c05117340b95c7e7c5a12f78491893af3.tar.gz
QmlDesigner.PropertyEditor: moving the color logic into component
Change-Id: I3d90618f5826cf77cc9813fd3b31fbfdbd5b50e7 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml36
1 files changed, 4 insertions, 32 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
index 75eea4c42f..13deba9b11 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
@@ -30,14 +30,12 @@
import QtQuick 2.1
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls.Styles 1.1
-import "Constants.js" as Constants
Controls.SpinBox {
id: spinBox
property color borderColor: "#222"
property color highlightColor: "orange"
- property color textColor: Constants.colorsDefaultText
-
+ property color textColor: colorLogic.textColor
property variant backendValue;
prefix: " "
@@ -52,37 +50,11 @@ Controls.SpinBox {
innerObject.evaluate();
}
- QtObject {
- id: innerObject
-
- property int valueFromBackend: spinBox.backendValue.value;
- property bool baseStateFlag: isBaseState;
-
+ ColorLogic {
+ id: colorLogic
+ backendValue: spinBox.backendValue
onValueFromBackendChanged: {
spinBox.value = valueFromBackend;
- evaluate();
- }
-
- onBaseStateFlagChanged: {
- evaluate();
- }
-
- function evaluate() {
- if (backendValue === undefined)
- return;
-
- if (baseStateFlag) {
- if (backendValue.isInModel)
- textColor = Constants.colorsChangedBaseText
- else
- textColor = Constants.colorsDefaultText
- } else {
- if (backendValue.isInSubState)
- textColor = Constants.colorsChangedStateText
- else
- textColor = Constants.colorsDefaultText
- }
-
}
}