@@ -17,7 +17,7 @@
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919
20−AbstractButton {
20+Item {
2121 id: root
2222 opacity: enabled ? 1 : 0.6
2323
@@ -25,9 +25,11 @@ AbstractButton {
2525 property string iconName
2626 property color foregroundColor: "#000000"
2727
28+ signal clicked();
29+
2830 UbuntuShape {
2931 anchors.fill: parent
30− opacity: root.pressed ? 1 : 0
32+ opacity: mouseArea.pressed ? 1 : 0
3133 Behavior on opacity {
3234 UbuntuNumberAnimation {}
3335 }
@@ -60,4 +62,17 @@ AbstractButton {
6062 UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration }
6163 }
6264 }
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+ }
6378}