mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
mapwidget.qml: animate the map type toggle image on click
Add a SequentialAnimation that performs a slight animation of the toggle image scale. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
8487873029
commit
09a0f74bd8
1 changed files with 13 additions and 0 deletions
|
@ -114,12 +114,25 @@ Item {
|
|||
}
|
||||
|
||||
Image {
|
||||
id: toggleImage
|
||||
x: 10; y: x
|
||||
source: "qrc:///mapwidget-toggle-" + (map.activeMapType === map.mapType.SATELLITE ? "street" : "satellite")
|
||||
|
||||
SequentialAnimation {
|
||||
id: toggleImageAnimation
|
||||
PropertyAnimation {
|
||||
target: toggleImage; property: "scale"; from: 1.0; to: 0.8; duration: 120;
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: toggleImage; property: "scale"; from: 0.8; to: 1.0; duration: 80;
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
map.activeMapType = map.activeMapType === map.mapType.SATELLITE ? map.mapType.STREET : map.mapType.SATELLITE
|
||||
toggleImageAnimation.restart()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue