notification count pop animation
This commit is contained in:
parent
5de09fd5e2
commit
8d074af824
1 changed files with 16 additions and 0 deletions
|
|
@ -48,11 +48,27 @@ M.BarSection {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
|
id: countLabel
|
||||||
label: root.count > 0 ? String(root.count) : ""
|
label: root.count > 0 ? String(root.count) : ""
|
||||||
color: M.Theme.base0D
|
color: M.Theme.base0D
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
transform: Scale {
|
||||||
|
id: countScale
|
||||||
|
origin.x: countLabel.width / 2
|
||||||
|
origin.y: countLabel.height / 2
|
||||||
|
xScale: 1; yScale: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
id: popAnim
|
||||||
|
NumberAnimation { target: countScale; properties: "xScale,yScale"; to: 1.4; duration: 100; easing.type: Easing.OutQuad }
|
||||||
|
NumberAnimation { target: countScale; properties: "xScale,yScale"; to: 1.0; duration: 200; easing.type: Easing.OutElastic }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onCountChanged: if (count > 0) popAnim.start()
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue