@@ -45,90 +45,96 @@ Column {
49− id: infoField
49+ id: shakeContainer
50− objectName: "infoTextLabel"
53 anchors.horizontalCenter: parent.horizontalCenter
50 anchors.horizontalCenter: parent.horizontalCenter
54− text: root.infoText
51+ width: parent.width
55− }
52+ spacing: units.gu(2)
59− anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
63− id: pinentryField
55+ id: infoField
64− objectName: "pinentryField"
56+ objectName: "infoTextLabel"
65 anchors.horizontalCenter: parent.horizontalCenter
59 anchors.horizontalCenter: parent.horizontalCenter
66− anchors.verticalCenter: parent.verticalCenter
60+ text: root.infoText
67− spacing: Math.max(0, Math.min(units.gu(3), (parent.width / root.maxPinLength) - units.gu(3)))
61+ }
70− property bool incorrectOverride: false
65+ anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
70+ objectName: "pinentryField"
71+ anchors.horizontalCenter: parent.horizontalCenter
72+ anchors.verticalCenter: parent.verticalCenter
73+ spacing: Math.max(0, Math.min(units.gu(3), (parent.width / root.maxPinLength) - units.gu(3)))
76+ property bool incorrectOverride: false
72− Repeater {
78+ Repeater {
73− model: pinentryField.text.length
79+ model: pinentryField.text.length
74− delegate: Rectangle {
80+ delegate: Rectangle {
75− color: "#f3f3e7"
81+ color: "#f3f3e7"
76− width: Math.min(units.gu(2), (pinContainer.width - pinContainer.height*2 ) / (root.maxPinLength >= 0 ? root.maxPinLength : 16))
82+ width: Math.min(units.gu(2), (pinContainer.width - pinContainer.height*2 ) / (root.maxPinLength >= 0 ? root.maxPinLength : 16))
77− height: width
83+ height: width
78− radius: width / 2
84+ radius: width / 2
82− function appendNumber(number) {
88+ function appendNumber(number) {
83− if (incorrectOverride) {
89+ if (incorrectOverride) {
84− incorrectOverride = false;
90+ incorrectOverride = false;
93+ pinentryField.text = pinentryField.text + number
96+ function backspace() {
87− pinentryField.text = pinentryField.text + number
97+ pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
90− function backspace() {
101+ id: wrongNoticeLabel
91− pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
102+ objectName: "wrongNoticeLabel"
105+ anchors.horizontalCenter: parent.horizontalCenter
106+ text: root.errorText
107+ visible: pinentryField.incorrectOverride
96− objectName: "wrongNoticeLabel"
99− anchors.horizontalCenter: parent.horizontalCenter
100− text: root.errorText
101− visible: pinentryField.incorrectOverride
104− AbstractButton {
110+ AbstractButton {
105− objectName: "backspaceIcon"
111+ objectName: "backspaceIcon"
106− anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
112+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
107− width: height
113+ width: height
110− anchors.fill: parent
116+ anchors.fill: parent
111− name: "erase"
117+ name: "erase"
112− color: "#f3f3e7"
118+ color: "#f3f3e7"
115− opacity: (pinentryField.text.length && !pinentryField.incorrectOverride) > 0 ? 1 : 0
121+ opacity: (pinentryField.text.length && !pinentryField.incorrectOverride) > 0 ? 1 : 0
117− Behavior on opacity {
123+ Behavior on opacity {
118− UbuntuNumberAnimation {}
124+ UbuntuNumberAnimation {}
121− onClicked: pinentryField.backspace()
127+ onClicked: pinentryField.backspace()
127− objectName: "retryLabel"
132+ objectName: "retryLabel"
128− fontSize: "x-small"
133+ fontSize: "x-small"
129− color: "#f3f3e7"
134+ color: "#f3f3e7"
130− anchors.horizontalCenter: parent.horizontalCenter
135+ anchors.horizontalCenter: parent.horizontalCenter
131− text: root.retryText
136+ text: root.retryText
134 ThinDivider {
140 ThinDivider {
@@ -204,6 +210,6 @@ Column {
204 WrongPasswordAnimation {
210 WrongPasswordAnimation {
205 id: wrongPasswordAnimation
211 id: wrongPasswordAnimation
206 objectName: "wrongPasswordAnimation"
212 objectName: "wrongPasswordAnimation"
207− target: root
213+ target: shakeContainer