From 2d101b725264dc62422067e9359ff3982f2e82fc Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 20 Jul 2017 00:06:08 +0300 Subject: 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 --- mobile-widgets/qml/MapWidget.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mobile-widgets/qml/MapWidget.qml') 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 { -- cgit v1.2.3-70-g09d2