on xenial help sign in
improve the pin lockscreen
a6f5521Michael Zanetti
qml/Components/PinLockscreen.qml+2−1
@@ -144,12 +144,13 @@ FocusScope {
144
144
145 AbstractButton {
145 AbstractButton {
146 objectName: "backspaceIcon"
146 objectName: "backspaceIcon"
147− anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
147+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom; margins: -units.gu(1) }
148 width: height
148 width: height
149 enabled: root.entryEnabled
149 enabled: root.entryEnabled
150
150
151 Icon {
151 Icon {
152 anchors.fill: parent
152 anchors.fill: parent
153+ anchors.margins: units.gu(1)
153 name: "erase"
154 name: "erase"
154 color: root.foregroundColor
155 color: root.foregroundColor
155 }
156 }
qml/Components/PinPadButton.qml+17−2
@@ -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,9 +25,11 @@ AbstractButton {
25 property string iconName
25 property string iconName
26 property color foregroundColor: "#000000"
26 property color foregroundColor: "#000000"
27
27
28+ signal clicked();
29+
28 UbuntuShape {
30 UbuntuShape {
29 anchors.fill: parent
31 anchors.fill: parent
30− opacity: root.pressed ? 1 : 0
32+ opacity: mouseArea.pressed ? 1 : 0
31 Behavior on opacity {
33 Behavior on opacity {
32 UbuntuNumberAnimation {}
34 UbuntuNumberAnimation {}
33 }
35 }
@@ -60,4 +62,17 @@ AbstractButton {
60 UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration }
62 UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration }
61 }
63 }
62 }
64 }
65+
66+ MouseArea {
67+ id: mouseArea
68+ anchors.fill: parent
69+
70+ // Intentionally using onReleased here to increase the robustness against
71+ // sloppy presses. This often happens when entering a pin very quickly and
72+ // the numbers for the pin are far apart.
73+ onReleased: {
74+ Haptics.play();
75+ root.clicked();
76+ }
77+ }
63}
78}