on xenial help sign in
provide the same scale animation when pressed
2d2a022Lukáš Tinkl
qml/Notifications/NotificationButton.qml+11−1
@@ -33,6 +33,7 @@ Rectangle {
33 signal clicked()
33 signal clicked()
34
34
35 AbstractButton {
35 AbstractButton {
36+ id: button
36 anchors.fill: root
37 anchors.fill: root
37 onClicked: root.clicked()
38 onClicked: root.clicked()
38
39
@@ -47,11 +48,20 @@ Rectangle {
47
48
48 Icon {
49 Icon {
49 id: icon
50 id: icon
50− height: parent.height / 3 * 2
51+ height: units.gu(3)
51 width: height
52 width: height
52 anchors.centerIn: parent
53 anchors.centerIn: parent
53 color: "white"
54 color: "white"
54 visible: !label.visible
55 visible: !label.visible
55 }
56 }
56 }
57 }
58+
59+ transformOrigin: Item.Top
60+ scale: button.pressed ? 0.98 : 1.0
61+ Behavior on scale {
62+ ScaleAnimator {
63+ duration: UbuntuAnimation.SnapDuration
64+ easing.type: Easing.Linear
65+ }
66+ }
57}
67}