diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-09-14 10:21:14 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-09-14 10:21:14 +0200 |
commit | a1e93b9eadc728a8c02cf4a36ea1a1a6fa7b7b46 (patch) | |
tree | 9ba056113878dba76cc26b2819f59929f3c09151 /framework/qml/RequiredTextField.qml | |
parent | f4bc66730d42988f5f3045d78c75512b739d02cb (diff) | |
download | kube-a1e93b9eadc728a8c02cf4a36ea1a1a6fa7b7b46.tar.gz kube-a1e93b9eadc728a8c02cf4a36ea1a1a6fa7b7b46.zip |
animate validation
Diffstat (limited to 'framework/qml/RequiredTextField.qml')
-rw-r--r-- | framework/qml/RequiredTextField.qml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/framework/qml/RequiredTextField.qml b/framework/qml/RequiredTextField.qml index 7552ebfb..0c76d144 100644 --- a/framework/qml/RequiredTextField.qml +++ b/framework/qml/RequiredTextField.qml | |||
@@ -25,6 +25,7 @@ Kube.TextField { | |||
25 | validator: RegExpValidator { regExp: /.*\S.*/ } | 25 | validator: RegExpValidator { regExp: /.*\S.*/ } |
26 | 26 | ||
27 | Rectangle { | 27 | Rectangle { |
28 | id: validIndicator | ||
28 | anchors { | 29 | anchors { |
29 | left: parent.left | 30 | left: parent.left |
30 | right: parent.right | 31 | right: parent.right |
@@ -32,6 +33,22 @@ Kube.TextField { | |||
32 | margins: 1 | 33 | margins: 1 |
33 | } | 34 | } |
34 | height: 3 | 35 | height: 3 |
35 | color: acceptableInput ? root.activefocus ? Kube.Colors.positiveColor : "transparent" : Kube.Colors.warningColor | 36 | color: acceptableInput ? Kube.Colors.positiveColor : Kube.Colors.warningColor |
37 | |||
38 | OpacityAnimator { | ||
39 | target: validIndicator | ||
40 | from: opacity | ||
41 | to: 0 | ||
42 | duration: 1000 | ||
43 | running: acceptableInput | ||
44 | } | ||
45 | |||
46 | OpacityAnimator { | ||
47 | target: validIndicator | ||
48 | from: opacity | ||
49 | to: 1 | ||
50 | duration: 100 | ||
51 | running: !acceptableInput | ||
52 | } | ||
36 | } | 53 | } |
37 | } | 54 | } |