mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
mapwidgetcontextmenu: add an Image for the context menu toggle
- add the PNG file into the QRC - add a simple scale animation for the Image on click Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
70a8402911
commit
de73cf1c90
3 changed files with 21 additions and 3 deletions
|
@ -2,8 +2,25 @@
|
|||
import QtQuick 2.7
|
||||
|
||||
Item {
|
||||
Rectangle {
|
||||
width: 100; height: width
|
||||
color: "white"
|
||||
Image {
|
||||
id: contextMenuImage
|
||||
source: "qrc:///mapwidget-context-menu"
|
||||
|
||||
SequentialAnimation {
|
||||
id:contextMenuImageAnimation
|
||||
PropertyAnimation {
|
||||
target: contextMenuImage; property: "scale"; from: 1.0; to: 0.8; duration: 80;
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: contextMenuImage; property: "scale"; from: 0.8; to: 1.0; duration: 60;
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
contextMenuImageAnimation.restart()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
mobile-widgets/qml/icons/mapwidget-context-menu.png
Normal file
BIN
mobile-widgets/qml/icons/mapwidget-context-menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 242 B |
|
@ -6,6 +6,7 @@
|
|||
<file alias="mapwidget-marker-selected">mobile-widgets/qml/icons/mapwidget-marker-selected.png</file>
|
||||
<file alias="mapwidget-toggle-satellite">mobile-widgets/qml/icons/mapwidget-toggle-satellite.png</file>
|
||||
<file alias="mapwidget-toggle-street">mobile-widgets/qml/icons/mapwidget-toggle-street.png</file>
|
||||
<file alias="mapwidget-context-menu">mobile-widgets/qml/icons/mapwidget-context-menu.png</file>
|
||||
<file alias="star">icons/star.svg</file>
|
||||
<file alias="subsurface-icon">icons/subsurface-icon.png</file>
|
||||
<file alias="subsurface-mobile-icon">icons/subsurface-mobile-icon.png</file>
|
||||
|
|
Loading…
Reference in a new issue