diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-20 00:06:08 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 2d101b725264dc62422067e9359ff3982f2e82fc (patch) | |
tree | c741d2559f70ccd3426ea9b41aa61133a2105967 | |
parent | 24d5485a884a501e00b0a8130add6078b08654f9 (diff) | |
download | subsurface-2d101b725264dc62422067e9359ff3982f2e82fc.tar.gz |
mapwidget.qml: play little animation on marker clicks
If a marker is clicked it's source image changes, which will
call the onSourceChanged() slot. If a marker is selected
play the newly added sourceItemAnimation which is a short scale
animation for the image.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index c3974f9e3..e581ade38 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -45,6 +45,21 @@ Item { sourceItem: Image { id: mapItemImage; source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : ""); + + SequentialAnimation { + id: mapItemImageAnimation; + PropertyAnimation { + target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120; + } + PropertyAnimation { + target: mapItemImage; property: "scale"; from: 0.7; to: 1.0; duration: 80; + } + } + + onSourceChanged: { + if (mapHelper.model.selectedUuid === model.uuid) + mapItemImageAnimation.restart(); + } } MouseArea { |