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 | |
parent | f4bc66730d42988f5f3045d78c75512b739d02cb (diff) | |
download | kube-a1e93b9eadc728a8c02cf4a36ea1a1a6fa7b7b46.tar.gz kube-a1e93b9eadc728a8c02cf4a36ea1a1a6fa7b7b46.zip |
animate validation
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qml/PasswordField.qml | 2 | ||||
-rw-r--r-- | framework/qml/RequiredTextField.qml | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/framework/qml/PasswordField.qml b/framework/qml/PasswordField.qml index fa1d1757..6fa48d44 100644 --- a/framework/qml/PasswordField.qml +++ b/framework/qml/PasswordField.qml | |||
@@ -19,7 +19,7 @@ | |||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
20 | import org.kube.framework 1.0 as Kube | 20 | import org.kube.framework 1.0 as Kube |
21 | 21 | ||
22 | Kube.RequiredTextField { | 22 | Kube.TextField { |
23 | id: root | 23 | id: root |
24 | 24 | ||
25 | property bool showPassword | 25 | property bool showPassword |
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 | } |