diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-20 03:13:12 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 09a0f74bd82552b247586daa9326323abec109a0 (patch) | |
tree | 54ef42d501462f9c9bb50ee4d0d83c421102e88c /mobile-widgets | |
parent | 8487873029638ba8b994e93e62ab9676b6b064d5 (diff) | |
download | subsurface-09a0f74bd82552b247586daa9326323abec109a0.tar.gz |
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>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 736f7bc7d..96dab8004 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -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() } } } |