1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

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>
This commit is contained in:
Lubomir I. Ivanov 2017-07-20 00:06:08 +03:00 committed by Dirk Hohndel
parent 24d5485a88
commit 2d101b7252

View file

@ -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 {