From 96292f0d3e68a0cce442a9a8f3baa7126d01093d Mon Sep 17 00:00:00 2001 From: davidsastresas Date: Tue, 19 Mar 2024 02:10:38 +0100 Subject: [PATCH] FlyviewVideo.qml: add OnScreenGimbalController for gimbal mouse actions control --- src/FlightDisplay/FlyViewVideo.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/FlightDisplay/FlyViewVideo.qml b/src/FlightDisplay/FlyViewVideo.qml index 25337f1..54a9956 100644 --- a/src/FlightDisplay/FlyViewVideo.qml +++ b/src/FlightDisplay/FlyViewVideo.qml @@ -88,6 +88,13 @@ Item { } } + OnScreenGimbalController { + id: onScreenGimbalController + anchors.fill: parent + screenX: flyViewVideoMouseArea.mouseX + screenY: flyViewVideoMouseArea.mouseY + } + MouseArea { id: flyViewVideoMouseArea anchors.fill: parent @@ -104,9 +111,13 @@ Item { property var trackingROI: null property var trackingStatus: trackingStatusComponent.createObject(flyViewVideoMouseArea, {}) + onClicked: onScreenGimbalController.clickControl() onDoubleClicked: QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen + onPressed: { + onScreenGimbalController.pressControl() + _track_rec_x = mouse.x _track_rec_y = mouse.y @@ -138,6 +149,8 @@ Item { } } onReleased: { + onScreenGimbalController.releaseControl() + //if there is already a selection, delete it if (trackingROI !== null) { trackingROI.destroy();