on xenial help sign in
fix haptics being out of sync
2e2611aMichael Zanetti
qml/Components/PinLockscreen.qml+2−10
@@ -197,11 +197,7 @@ FocusScope {
197 pinentryField.text.length < root.maxPinLength ||
197 pinentryField.text.length < root.maxPinLength ||
198 pinentryField.incorrectOverride)
198 pinentryField.incorrectOverride)
199
199
200− onPressedChanged: {
201− if (!pressed) {
202− pinentryField.appendNumber(index + 1)
200+ onClicked: pinentryField.appendNumber(index + 1)
203− }
204− }
205 }
201 }
206 }
202 }
207 Item {
203 Item {
@@ -217,11 +213,7 @@ FocusScope {
217 pinentryField.text.length < root.maxPinLength ||
213 pinentryField.text.length < root.maxPinLength ||
218 pinentryField.incorrectOverride)
214 pinentryField.incorrectOverride)
219
215
220− onPressedChanged: {
221− if (!pressed) {
222− pinentryField.appendNumber(0)
216+ onClicked: pinentryField.appendNumber(0)
223− }
224− }
225 }
217 }
226 Item {
218 Item {
227 height: numbersGrid.buttonHeight
219 height: numbersGrid.buttonHeight
qml/Components/PinPadButton.qml+18−1
@@ -17,7 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19
19
20−AbstractButton {
20+Item {
21 id: root
21 id: root
22 opacity: enabled ? 1 : 0.6
22 opacity: enabled ? 1 : 0.6
23
23
@@ -25,6 +25,10 @@ AbstractButton {
25 property string iconName
25 property string iconName
26 property color foregroundColor: "#000000"
26 property color foregroundColor: "#000000"
27
27
28+ readonly property alias pressed: mouseArea.pressed
29+
30+ signal clicked();
31+
28 UbuntuShape {
32 UbuntuShape {
29 anchors.fill: parent
33 anchors.fill: parent
30 opacity: root.pressed ? 1 : 0
34 opacity: root.pressed ? 1 : 0
@@ -60,4 +64,17 @@ AbstractButton {
60 UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration }
64 UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration }
61 }
65 }
62 }
66 }
67+
68+ MouseArea {
69+ id: mouseArea
70+ anchors.fill: parent
71+
72+ // Intentionally using onReleased here to increase the robustness against
73+ // sloppy presses. This often happens when entering a pin very quickly and
74+ // the numbers for the pin are far apart.
75+ onReleased: {
76+ Haptics.play();
77+ root.clicked();
78+ }
79+ }
63}
80}