From b2082edb8bbe0954f881a88c8e366262c7fdbe56 Mon Sep 17 00:00:00 2001 From: Pierre TILAK Date: Mon, 15 Jul 2019 14:49:20 +1200 Subject: [PATCH] Changes on Compass COG cursor --- qgcimages.qrc | 1 + src/FlightMap/Images/cOGPointer.svg | 53 ++++++++++++++++++++++ src/FlightMap/Widgets/QGCCompassWidget.qml | 37 ++++++--------- 3 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 src/FlightMap/Images/cOGPointer.svg diff --git a/qgcimages.qrc b/qgcimages.qrc index 446cea18c..e47fcc1e1 100644 --- a/qgcimages.qrc +++ b/qgcimages.qrc @@ -69,6 +69,7 @@ src/MissionManager/CogWheel.svg src/FlightMap/Images/compassInstrumentArrow.svg src/FlightMap/Images/compassInstrumentDial.svg + src/FlightMap/Images/cOGPointer.svg src/ui/toolbar/Images/Connect.svg src/FlightMap/Images/crossHair.svg src/AutoPilotPlugins/PX4/Images/DatalinkLoss.svg diff --git a/src/FlightMap/Images/cOGPointer.svg b/src/FlightMap/Images/cOGPointer.svg new file mode 100644 index 000000000..22123eb95 --- /dev/null +++ b/src/FlightMap/Images/cOGPointer.svg @@ -0,0 +1,53 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/FlightMap/Widgets/QGCCompassWidget.qml b/src/FlightMap/Widgets/QGCCompassWidget.qml index d3036a034..ed3642594 100644 --- a/src/FlightMap/Widgets/QGCCompassWidget.qml +++ b/src/FlightMap/Widgets/QGCCompassWidget.qml @@ -58,6 +58,21 @@ Item { anchors.fill: parent visible: false + Image { + id: cOGPointer + source: _showCOGAngleCompass ? "/qmlimages/cOGPointer.svg" : "" + mipmap: true + fillMode: Image.PreserveAspectFit + anchors.fill: parent + sourceSize.height: parent.height + + transform: Rotation { + origin.x: cOGPointer.width / 2 + origin.y: cOGPointer.height / 2 + angle: _courseOverGround - _heading + } + } + Image { id: pointer width: size * 0.65 @@ -99,28 +114,6 @@ Item { } } - Image { - id: cOGPointer - source: _showCOGAngleCompass ? "/qmlimages/attitudePointer.svg" : "" - mipmap: true - fillMode: Image.PreserveAspectFit - anchors.fill: parent - sourceSize.height: parent.height - - onVisibleChanged: { - if (visible) - console.log("is being displayed") - else - console.log("is being hidden") - } - - - transform: Rotation { - origin.x: cOGPointer.width / 2 - origin.y: cOGPointer.height / 2 - angle: _courseOverGround - _heading - } - } Rectangle { anchors.centerIn: parent -- 2.22.0