diff options
-rw-r--r-- | framework/qml/PasswordField.qml | 5 | ||||
-rw-r--r-- | framework/qml/RequiredTextField.qml | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/framework/qml/PasswordField.qml b/framework/qml/PasswordField.qml index 786b3d46..fa1d1757 100644 --- a/framework/qml/PasswordField.qml +++ b/framework/qml/PasswordField.qml | |||
@@ -19,11 +19,10 @@ | |||
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.TextField { | 22 | Kube.RequiredTextField { |
23 | id: root | 23 | id: root |
24 | 24 | ||
25 | property bool showPassword | 25 | property bool showPassword |
26 | |||
27 | echoMode: showPassword ? TextInput.Normal : TextInput.Password | 26 | echoMode: showPassword ? TextInput.Normal : TextInput.Password |
28 | 27 | ||
29 | Kube.IconButton { | 28 | Kube.IconButton { |
@@ -31,11 +30,9 @@ Kube.TextField { | |||
31 | right: parent.right | 30 | right: parent.right |
32 | verticalCenter: parent.verticalCenter | 31 | verticalCenter: parent.verticalCenter |
33 | } | 32 | } |
34 | |||
35 | onClicked: { | 33 | onClicked: { |
36 | root.showPassword = !root.showPassword | 34 | root.showPassword = !root.showPassword |
37 | } | 35 | } |
38 | |||
39 | iconName: root.showPassword ? Kube.Icons.password_hide : Kube.Icons.password_show | 36 | iconName: root.showPassword ? Kube.Icons.password_hide : Kube.Icons.password_show |
40 | } | 37 | } |
41 | } | 38 | } |
diff --git a/framework/qml/RequiredTextField.qml b/framework/qml/RequiredTextField.qml index 9ee3bece..7552ebfb 100644 --- a/framework/qml/RequiredTextField.qml +++ b/framework/qml/RequiredTextField.qml | |||
@@ -23,6 +23,15 @@ import org.kube.framework 1.0 as Kube | |||
23 | Kube.TextField { | 23 | Kube.TextField { |
24 | id: root | 24 | id: root |
25 | validator: RegExpValidator { regExp: /.*\S.*/ } | 25 | validator: RegExpValidator { regExp: /.*\S.*/ } |
26 | backgroundColor: acceptableInput ? Kube.Colors.viewBackgroundColor : Kube.Colors.warningColor | 26 | |
27 | backgroundOpacity: acceptableInput ? 1.0 : 0.2 | 27 | Rectangle { |
28 | anchors { | ||
29 | left: parent.left | ||
30 | right: parent.right | ||
31 | bottom: parent.bottom | ||
32 | margins: 1 | ||
33 | } | ||
34 | height: 3 | ||
35 | color: acceptableInput ? root.activefocus ? Kube.Colors.positiveColor : "transparent" : Kube.Colors.warningColor | ||
36 | } | ||
28 | } | 37 | } |