@@ -69,8 +69,6 @@ Showable {
6969 signal emergencyCall()
7070 signal infoPopupConfirmed()
7171
72− onActiveFocusChanged: if (activeFocus && pinPadLoader.item) pinPadLoader.item.forceActiveFocus()
73−
7472 function reset() {
7573 // This causes the loader below to destry and recreate the source
7674 pinPadLoader.resetting = true;
@@ -121,108 +119,94 @@ Showable {
121119 opacity: root.darkenBackground
122120 }
123121
124− MouseArea {
125− anchors.fill: root
126− onClicked: {
127− if (pinPadLoader.item)
128− pinPadLoader.item.forceActiveFocus()
129− }
130− }
131−
132− FocusScope {
133− id: loaderScope
122+ Loader {
123+ id: pinPadLoader
124+ objectName: "pinPadLoader"
134125 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− }
126+ property bool resetting: false
127+ property bool waiting: false
128+ property bool showWrongText: false
129+ focus: true
130+
131+ source: {
132+ if (resetting || !root.required) {
133+ return ""
134+ } else if (root.delayMinutes > 0) {
135+ return "DelayedLockscreen.qml"
136+ } else if (root.alphaNumeric) {
137+ return "PassphraseLockscreen.qml"
138+ } else {
139+ return "PinLockscreen.qml"
154140 }
155− onSourceChanged: {
156− waiting = false
157− showWrongText = false
158− if (loaderScope.activeFocus && pinPadLoader.item)
159− pinPadLoader.item.forceActiveFocus()
160− }
161−
162− Connections {
163− target: pinPadLoader.item
141+ }
142+ onSourceChanged: {
143+ waiting = false
144+ showWrongText = false
145+ }
164146
165− onEntered: {
166− pinPadLoader.waiting = true
167− root.entered(passphrase);
168− }
147+ Connections {
148+ target: pinPadLoader.item
169149
170− onCancel: {
171− root.cancel()
172− }
150+ onEntered: {
151+ pinPadLoader.waiting = true
152+ root.entered(passphrase);
173153 }
174154
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
155+ onCancel: {
156+ root.cancel()
224157 }
225158 }
159+
160+ Binding {
161+ target: pinPadLoader.item
162+ property: "minPinLength"
163+ value: root.minPinLength
164+ }
165+ Binding {
166+ target: pinPadLoader.item
167+ property: "maxPinLength"
168+ value: root.maxPinLength
169+ }
170+ Binding {
171+ target: pinPadLoader.item
172+ property: "infoText"
173+ value: root.infoText
174+ }
175+ Binding {
176+ target: pinPadLoader.item
177+ property: "retryText"
178+ value: root.retryText
179+ }
180+ Binding {
181+ target: pinPadLoader.item
182+ property: "errorText"
183+ value: pinPadLoader.showWrongText ? root.errorText : ""
184+ }
185+ Binding {
186+ target: pinPadLoader.item
187+ property: "entryEnabled"
188+ value: !pinPadLoader.waiting
189+ }
190+ Binding {
191+ target: pinPadLoader.item
192+ property: "alphaNumeric"
193+ value: root.alphaNumeric
194+ }
195+ Binding {
196+ target: pinPadLoader.item
197+ property: "delayMinutes"
198+ value: root.delayMinutes
199+ }
200+ Binding {
201+ target: pinPadLoader.item
202+ property: "showCancelButton"
203+ value: root.showCancelButton
204+ }
205+ Binding {
206+ target: pinPadLoader.item
207+ property: "foregroundColor"
208+ value: root.foregroundColor
209+ }
226210 }
227211
228212 Item {