summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-20 18:25:01 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitde73cf1c90e2459f5c8b7f4196282887fe0ff623 (patch)
tree2f6ee02254f8376afc63f1b558acafaa3f80136f
parent70a8402911dfe0659cdaca7f83f00e42116fdbec (diff)
downloadsubsurface-de73cf1c90e2459f5c8b7f4196282887fe0ff623.tar.gz
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>
-rw-r--r--mobile-widgets/qml/MapWidgetContextMenu.qml23
-rw-r--r--mobile-widgets/qml/icons/mapwidget-context-menu.pngbin0 -> 242 bytes
-rw-r--r--subsurface.qrc1
3 files changed, 21 insertions, 3 deletions
diff --git a/mobile-widgets/qml/MapWidgetContextMenu.qml b/mobile-widgets/qml/MapWidgetContextMenu.qml
index f26a700f7..47616de30 100644
--- a/mobile-widgets/qml/MapWidgetContextMenu.qml
+++ b/mobile-widgets/qml/MapWidgetContextMenu.qml
@@ -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()
+ }
+ }
}
}
diff --git a/mobile-widgets/qml/icons/mapwidget-context-menu.png b/mobile-widgets/qml/icons/mapwidget-context-menu.png
new file mode 100644
index 000000000..6ab7cf77d
--- /dev/null
+++ b/mobile-widgets/qml/icons/mapwidget-context-menu.png
Binary files differ
diff --git a/subsurface.qrc b/subsurface.qrc
index 00113696c..017451c3c 100644
--- a/subsurface.qrc
+++ b/subsurface.qrc
@@ -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>