@@ -45,90 +45,96 @@ Column {
4545 }
4646 }
4747
48− Label {
49− id: infoField
50− objectName: "infoTextLabel"
51− fontSize: "large"
52− color: "#f3f3e7"
48+ Column {
49+ id: shakeContainer
5350 anchors.horizontalCenter: parent.horizontalCenter
54− text: root.infoText
55− }
56−
57− Item {
58− id: pinContainer
59− anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
60− height: units.gu(4)
51+ width: parent.width
52+ spacing: units.gu(2)
6153
62− Row {
63− id: pinentryField
64− objectName: "pinentryField"
54+ Label {
55+ id: infoField
56+ objectName: "infoTextLabel"
57+ fontSize: "large"
58+ color: "#f3f3e7"
6559 anchors.horizontalCenter: parent.horizontalCenter
66− anchors.verticalCenter: parent.verticalCenter
67− spacing: Math.max(0, Math.min(units.gu(3), (parent.width / root.maxPinLength) - units.gu(3)))
68−
69− property string text
70− property bool incorrectOverride: false
60+ text: root.infoText
61+ }
7162
72− Repeater {
73− model: pinentryField.text.length
74− delegate: Rectangle {
75− color: "#f3f3e7"
76− width: Math.min(units.gu(2), (pinContainer.width - pinContainer.height*2 ) / (root.maxPinLength >= 0 ? root.maxPinLength : 16))
77− height: width
78− radius: width / 2
63+ Item {
64+ id: pinContainer
65+ anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
66+ height: units.gu(4)
67+
68+ Row {
69+ id: pinentryField
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)))
74+
75+ property string text
76+ property bool incorrectOverride: false
77+
78+ Repeater {
79+ model: pinentryField.text.length
80+ delegate: Rectangle {
81+ color: "#f3f3e7"
82+ width: Math.min(units.gu(2), (pinContainer.width - pinContainer.height*2 ) / (root.maxPinLength >= 0 ? root.maxPinLength : 16))
83+ height: width
84+ radius: width / 2
85+ }
7986 }
80− }
8187
82− function appendNumber(number) {
83− if (incorrectOverride) {
84− incorrectOverride = false;
88+ function appendNumber(number) {
89+ if (incorrectOverride) {
90+ incorrectOverride = false;
91+ }
92+
93+ pinentryField.text = pinentryField.text + number
8594 }
8695
87− pinentryField.text = pinentryField.text + number
96+ function backspace() {
97+ pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
98+ }
8899 }
89−
90− function backspace() {
91− pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
100+ Label {
101+ id: wrongNoticeLabel
102+ objectName: "wrongNoticeLabel"
103+ fontSize: "x-large"
104+ color: "#f3f3e7"
105+ anchors.horizontalCenter: parent.horizontalCenter
106+ text: root.errorText
107+ visible: pinentryField.incorrectOverride
92108 }
93− }
94− Label {
95− id: wrongNoticeLabel
96− objectName: "wrongNoticeLabel"
97− fontSize: "x-large"
98− color: "#f3f3e7"
99− anchors.horizontalCenter: parent.horizontalCenter
100− text: root.errorText
101− visible: pinentryField.incorrectOverride
102− }
103109
104− AbstractButton {
105− objectName: "backspaceIcon"
106− anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
107− width: height
110+ AbstractButton {
111+ objectName: "backspaceIcon"
112+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
113+ width: height
108114
109− Icon {
110− anchors.fill: parent
111− name: "erase"
112− color: "#f3f3e7"
113− }
115+ Icon {
116+ anchors.fill: parent
117+ name: "erase"
118+ color: "#f3f3e7"
119+ }
114120
115− opacity: (pinentryField.text.length && !pinentryField.incorrectOverride) > 0 ? 1 : 0
121+ opacity: (pinentryField.text.length && !pinentryField.incorrectOverride) > 0 ? 1 : 0
116122
117− Behavior on opacity {
118− UbuntuNumberAnimation {}
119− }
123+ Behavior on opacity {
124+ UbuntuNumberAnimation {}
125+ }
120126
121− onClicked: pinentryField.backspace()
127+ onClicked: pinentryField.backspace()
128+ }
122129 }
123− }
124130
125−
126− Label {
127− objectName: "retryLabel"
128− fontSize: "x-small"
129− color: "#f3f3e7"
130− anchors.horizontalCenter: parent.horizontalCenter
131− text: root.retryText
131+ Label {
132+ objectName: "retryLabel"
133+ fontSize: "x-small"
134+ color: "#f3f3e7"
135+ anchors.horizontalCenter: parent.horizontalCenter
136+ text: root.retryText
137+ }
132138 }
133139
134140 ThinDivider {
@@ -204,6 +210,6 @@ Column {
204210 WrongPasswordAnimation {
205211 id: wrongPasswordAnimation
206212 objectName: "wrongPasswordAnimation"
207− target: root
213+ target: shakeContainer
208214 }
209215}