18 import Ubuntu.Components 0.1
19 import
"../Components"
23 height: highlightItem.height
25 property string placeholderText
26 property string wrongPlaceholderText
27 property string username:
""
29 signal entered(
string passphrase)
32 function clear(playAnimation) {
33 pinentryField.text =
"";
35 wrongPasswordAnimation.start();
37 pinentryField.focus =
false
45 anchors.centerIn: parent
46 color: Qt.rgba(0.1, 0.1, 0.1, 0.4)
47 border.color: Qt.rgba(0.4, 0.4, 0.4, 0.4)
48 border.width: units.dp(1)
53 objectName:
"greeterLabel"
58 margins: units.gu(1.5)
60 text: root.username.length > 0 ? i18n.tr(
"Hello %1").arg(root.username) : i18n.tr(
"Hello")
66 objectName:
"pinentryField"
68 horizontalCenter: parent.horizontalCenter
73 width: parent.width - units.gu(2)
74 echoMode: TextInput.Password
77 placeholderText: wrongPasswordAnimation.running ? root.wrongPlaceholderText : root.placeholderText
80 if (pinentryField.text) {
81 root.entered(pinentryField.text);
87 WrongPasswordAnimation {
88 id: wrongPasswordAnimation
89 objectName:
"wrongPasswordAnimation"