summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-09-14 09:45:45 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-09-14 09:45:45 +0200
commitf4bc66730d42988f5f3045d78c75512b739d02cb (patch)
tree527c67ce174430a839aeca2ec91a56486c9b91e2
parent150dcdbc142d718f01b43f01f7a7f14db44f55fe (diff)
downloadkube-f4bc66730d42988f5f3045d78c75512b739d02cb.tar.gz
kube-f4bc66730d42988f5f3045d78c75512b739d02cb.zip
improve requierd text visualisation
-rw-r--r--framework/qml/PasswordField.qml5
-rw-r--r--framework/qml/RequiredTextField.qml13
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 @@
19import QtQuick 2.7 19import QtQuick 2.7
20import org.kube.framework 1.0 as Kube 20import org.kube.framework 1.0 as Kube
21 21
22Kube.TextField { 22Kube.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
23Kube.TextField { 23Kube.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}