on xenial help sign in
Update from passphrase-ui-tweaks
f93342eMichael Terry
qml/Components/Lockscreen.qml+76−70
@@ -101,83 +101,89 @@ Showable {
101 anchors.fill: root
101 anchors.fill: root
102 }
102 }
103
103
104− Loader {
104+ FocusScope {
105− id: pinPadLoader
105+ id: loaderScope
106− objectName: "pinPadLoader"
107 anchors.fill: parent
106 anchors.fill: parent
107+
108+ Loader {
109+ id: pinPadLoader
110+ objectName: "pinPadLoader"
111+ anchors.fill: parent
108− property bool resetting: false
112+ property bool resetting: false
109− property bool waiting: false
113+ property bool waiting: false
110− property bool showWrongText: false
114+ property bool showWrongText: false
111−
115+
112− source: {
116+ source: {
113− if (resetting || !root.required) {
117+ if (resetting || !root.required) {
114− return ""
118+ return ""
115− } else if (root.delayMinutes > 0) {
119+ } else if (root.delayMinutes > 0) {
116− return "DelayedLockscreen.qml"
120+ return "DelayedLockscreen.qml"
117− } else if (root.alphaNumeric) {
121+ } else if (root.alphaNumeric) {
118− return "PassphraseLockscreen.qml"
122+ return "PassphraseLockscreen.qml"
119− } else {
123+ } else {
120− return "PinLockscreen.qml"
124+ return "PinLockscreen.qml"
125+ }
126+ }
127+ onSourceChanged: {
128+ waiting = false
129+ showWrongText = false
130+ if (loaderScope.activeFocus)
131+ clear(false)
121 }
132 }
122− }
123− onSourceChanged: {
124− waiting = false
125− showWrongText = false
126− clear(false)
127− }
128
133
129− Connections {
134+ Connections {
130− target: pinPadLoader.item
135+ target: pinPadLoader.item
131
136
132− onEntered: {
137+ onEntered: {
133− pinPadLoader.waiting = true
138+ pinPadLoader.waiting = true
134− root.entered(passphrase);
139+ root.entered(passphrase);
135− }
140+ }
136
141
137− onCancel: {
142+ onCancel: {
138− root.cancel()
143+ root.cancel()
144+ }
139 }
145 }
140− }
141
146
142− Binding {
147+ Binding {
143− target: pinPadLoader.item
148+ target: pinPadLoader.item
144− property: "minPinLength"
149+ property: "minPinLength"
145− value: root.minPinLength
150+ value: root.minPinLength
146− }
151+ }
147− Binding {
152+ Binding {
148− target: pinPadLoader.item
153+ target: pinPadLoader.item
149− property: "maxPinLength"
154+ property: "maxPinLength"
150− value: root.maxPinLength
155+ value: root.maxPinLength
151− }
156+ }
152− Binding {
157+ Binding {
153− target: pinPadLoader.item
158+ target: pinPadLoader.item
154− property: "infoText"
159+ property: "infoText"
155− value: root.infoText
160+ value: root.infoText
156− }
161+ }
157− Binding {
162+ Binding {
158− target: pinPadLoader.item
163+ target: pinPadLoader.item
159− property: "retryText"
164+ property: "retryText"
160− value: root.retryText
165+ value: root.retryText
161− }
166+ }
162− Binding {
167+ Binding {
163− target: pinPadLoader.item
168+ target: pinPadLoader.item
164− property: "errorText"
169+ property: "errorText"
165− value: pinPadLoader.showWrongText ? root.errorText : ""
170+ value: pinPadLoader.showWrongText ? root.errorText : ""
166− }
171+ }
167− Binding {
172+ Binding {
168− target: pinPadLoader.item
173+ target: pinPadLoader.item
169− property: "entryEnabled"
174+ property: "entryEnabled"
170− value: !pinPadLoader.waiting
175+ value: !pinPadLoader.waiting
171− }
176+ }
172− Binding {
177+ Binding {
173− target: pinPadLoader.item
178+ target: pinPadLoader.item
174− property: "alphaNumeric"
179+ property: "alphaNumeric"
175− value: root.alphaNumeric
180+ value: root.alphaNumeric
176− }
181+ }
177− Binding {
182+ Binding {
178− target: pinPadLoader.item
183+ target: pinPadLoader.item
179− property: "delayMinutes"
184+ property: "delayMinutes"
180− value: root.delayMinutes
185+ value: root.delayMinutes
186+ }
181 }
187 }
182 Binding {
188 Binding {
183 target: pinPadLoader.item
189 target: pinPadLoader.item
qml/Components/PassphraseLockscreen.qml+3−4
@@ -87,13 +87,12 @@ Item {
87 cursorPosition = length
87 cursorPosition = length
88 }
88 }
89 }
89 }
90− enabled: root.entryEnabled
91 clip: true
90 clip: true
92
91
93− onTextChanged: incorrectOverride = true
92+ // simulate being disabled, but without removing OSK focus
93+ maximumLength: root.entryEnabled ? 32767 : length
94
94
95− onActiveFocusChanged: if (!activeFocus) pinentryField.forceActiveFocus()
95+ onTextChanged: incorrectOverride = true
96− onEnabledChanged: if (enabled) pinentryField.forceActiveFocus()
97
96
98 onAccepted: {
97 onAccepted: {
99 if (pinentryField.text) {
98 if (pinentryField.text) {