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 446cea1..e47fcc1 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 0000000..22123eb --- /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 d3036a0..ed36425 100644 --- a/src/FlightMap/Widgets/QGCCompassWidget.qml +++ b/src/FlightMap/Widgets/QGCCompassWidget.qml @@ -59,6 +59,21 @@ Item { 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 source: vehicle ? vehicle.vehicleImageCompass : "" @@ -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