From de73cf1c90e2459f5c8b7f4196282887fe0ff623 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 20 Jul 2017 18:25:01 +0300 Subject: [PATCH] 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 --- mobile-widgets/qml/MapWidgetContextMenu.qml | 23 +++++++++++++++--- .../qml/icons/mapwidget-context-menu.png | Bin 0 -> 242 bytes subsurface.qrc | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 mobile-widgets/qml/icons/mapwidget-context-menu.png 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 0000000000000000000000000000000000000000..6ab7cf77d07df848e3a8fa235e5236535edf8d56 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdd@S zqpu?a!^U}uK91i(I+8ttd>I(3R2di=ni&{={s+=87#M;$7#Kw(7#OUkGcbtfUyqWX z092dd>EaktaqG=AMZN<89L}ddi5@>t^nY=JCEK*lo4z_fRpPgBU3H4%@F-6X;%->Q zw=?`|)vAsg@7}#*(BtW5F=G literal 0 HcmV?d00001 diff --git a/subsurface.qrc b/subsurface.qrc index 00113696c..017451c3c 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -6,6 +6,7 @@ mobile-widgets/qml/icons/mapwidget-marker-selected.png mobile-widgets/qml/icons/mapwidget-toggle-satellite.png mobile-widgets/qml/icons/mapwidget-toggle-street.png + mobile-widgets/qml/icons/mapwidget-context-menu.png icons/star.svg icons/subsurface-icon.png icons/subsurface-mobile-icon.png