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:
parent
24d5485a88
commit
2d101b7252
1 changed files with 15 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue