@@ -121,108 +121,94 @@ Showable {
121121 opacity: root.darkenBackground
122122 }
123123
124− MouseArea {
125− anchors.fill: root
126− onClicked: {
127− if (pinPadLoader.item)
128− pinPadLoader.item.forceActiveFocus()
129− }
130− }
131−
132− FocusScope {
133− id: loaderScope
124+ Loader {
125+ id: pinPadLoader
126+ objectName: "pinPadLoader"
134127 anchors.fill: parent
135−
136− Loader {
137− id: pinPadLoader
138− objectName: "pinPadLoader"
139− anchors.fill: parent
140− property bool resetting: false
141− property bool waiting: false
142− property bool showWrongText: false
143−
144− source: {
145− if (resetting || !root.required) {
146− return ""
147− } else if (root.delayMinutes > 0) {
148− return "DelayedLockscreen.qml"
149− } else if (root.alphaNumeric) {
150− return "PassphraseLockscreen.qml"
151− } else {
152− return "PinLockscreen.qml"
153− }
154− }
155− onSourceChanged: {
156− waiting = false
157− showWrongText = false
158− if (loaderScope.activeFocus && pinPadLoader.item)
159− pinPadLoader.item.forceActiveFocus()
128+ property bool resetting: false
129+ property bool waiting: false
130+ property bool showWrongText: false
131+ focus: true
132+
133+ source: {
134+ if (resetting || !root.required) {
135+ return ""
136+ } else if (root.delayMinutes > 0) {
137+ return "DelayedLockscreen.qml"
138+ } else if (root.alphaNumeric) {
139+ return "PassphraseLockscreen.qml"
140+ } else {
141+ return "PinLockscreen.qml"
160142 }
143+ }
144+ onSourceChanged: {
145+ waiting = false
146+ showWrongText = false
147+ }
161148
162− Connections {
163− target: pinPadLoader.item
164−
165− onEntered: {
166− pinPadLoader.waiting = true
167− root.entered(passphrase);
168− }
149+ Connections {
150+ target: pinPadLoader.item
169151
170− onCancel: {
171− root.cancel()
172− }
152+ onEntered: {
153+ pinPadLoader.waiting = true
154+ root.entered(passphrase);
173155 }
174156
175− Binding {
176− target: pinPadLoader.item
177− property: "minPinLength"
178− value: root.minPinLength
179− }
180− Binding {
181− target: pinPadLoader.item
182− property: "maxPinLength"
183− value: root.maxPinLength
184− }
185− Binding {
186− target: pinPadLoader.item
187− property: "infoText"
188− value: root.infoText
189− }
190− Binding {
191− target: pinPadLoader.item
192− property: "retryText"
193− value: root.retryText
194− }
195− Binding {
196− target: pinPadLoader.item
197− property: "errorText"
198− value: pinPadLoader.showWrongText ? root.errorText : ""
199− }
200− Binding {
201− target: pinPadLoader.item
202− property: "entryEnabled"
203− value: !pinPadLoader.waiting
204− }
205− Binding {
206− target: pinPadLoader.item
207− property: "alphaNumeric"
208− value: root.alphaNumeric
209− }
210− Binding {
211− target: pinPadLoader.item
212− property: "delayMinutes"
213− value: root.delayMinutes
214− }
215− Binding {
216− target: pinPadLoader.item
217− property: "showCancelButton"
218− value: root.showCancelButton
219− }
220− Binding {
221− target: pinPadLoader.item
222− property: "foregroundColor"
223− value: root.foregroundColor
157+ onCancel: {
158+ root.cancel()
224159 }
225160 }
161+
162+ Binding {
163+ target: pinPadLoader.item
164+ property: "minPinLength"
165+ value: root.minPinLength
166+ }
167+ Binding {
168+ target: pinPadLoader.item
169+ property: "maxPinLength"
170+ value: root.maxPinLength
171+ }
172+ Binding {
173+ target: pinPadLoader.item
174+ property: "infoText"
175+ value: root.infoText
176+ }
177+ Binding {
178+ target: pinPadLoader.item
179+ property: "retryText"
180+ value: root.retryText
181+ }
182+ Binding {
183+ target: pinPadLoader.item
184+ property: "errorText"
185+ value: pinPadLoader.showWrongText ? root.errorText : ""
186+ }
187+ Binding {
188+ target: pinPadLoader.item
189+ property: "entryEnabled"
190+ value: !pinPadLoader.waiting
191+ }
192+ Binding {
193+ target: pinPadLoader.item
194+ property: "alphaNumeric"
195+ value: root.alphaNumeric
196+ }
197+ Binding {
198+ target: pinPadLoader.item
199+ property: "delayMinutes"
200+ value: root.delayMinutes
201+ }
202+ Binding {
203+ target: pinPadLoader.item
204+ property: "showCancelButton"
205+ value: root.showCancelButton
206+ }
207+ Binding {
208+ target: pinPadLoader.item
209+ property: "foregroundColor"
210+ value: root.foregroundColor
211+ }
226212 }
227213
228214 Item {