4import QGroundControl.Controls
10 property Item pipState: videoPipState
14 pipView: _root.pipView
17 onWindowAboutToOpen: {
18 QGroundControl.videoManager.stopVideo()
19 videoStartDelay.start()
22 onWindowAboutToClose: {
23 QGroundControl.videoManager.stopVideo()
24 videoStartDelay.start()
28 if (pipState.state !== pipState.fullState) {
29 QGroundControl.videoManager.fullScreen = false
39 onTriggered: QGroundControl.videoManager.startVideo()
43 FlightDisplayViewVideo {
46 useSmallFont: _root.pipState.state !== _root.pipState.fullState
47 visible: QGroundControl.videoManager.isStreamSource || QGroundControl.videoManager.isUvc
51 text: qsTr("Double-click to exit full screen")
52 font.pointSize: ScreenTools.largeFontPointSize
53 visible: QGroundControl.videoManager.fullScreen
54 anchors.centerIn: parent
58 labelAnimation.start()
62 PropertyAnimation on opacity {
67 easing.type: Easing.InExpo
71 OnScreenGimbalController {
72 id: onScreenGimbalController
74 cameraTrackingEnabled: !!(videoStreaming._camera && videoStreaming._camera.trackingEnabled)
77 OnScreenCameraTrackingController {
78 id: cameraTrackingController
80 camera: videoStreaming._camera
81 videoWidth: videoStreaming.getWidth()
82 videoHeight: videoStreaming.getHeight()
86 id: flyViewVideoMouseArea
88 enabled: pipState.state === pipState.fullState
90 property real _pressX: 0
91 property real _pressY: 0
92 property bool _dragging: false
93 property bool _doubleClicked: false
94 readonly property real _dragThreshold: 10
96 // Defer single-click handling so a double-click (fullscreen toggle) doesn't also
97 // fire an unintended gimbal click-to-point/tracking command on its first click.
100 interval: Qt.styleHints.mouseDoubleClickInterval
103 property real clickX: 0
104 property real clickY: 0
107 onScreenGimbalController.mouseClicked(clickX, clickY)
108 cameraTrackingController.mouseClicked(clickX, clickY)
113 // Fires on the second press of a double-click. The second release still emits
114 // onReleased, so flag it to prevent re-arming the single-click timer.
115 _doubleClicked = true
116 singleClickTimer.stop()
117 QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
120 onPressed: (mouse) => {
124 // Clear any stale flag (e.g. double-click followed by drag releases through the
125 // drag branch without consuming it). Safe: pressed is emitted before doubleClicked.
126 _doubleClicked = false
129 onPositionChanged: (mouse) => {
130 if (!_dragging && (Math.abs(mouse.x - _pressX) >= _dragThreshold || Math.abs(mouse.y - _pressY) >= _dragThreshold)) {
132 onScreenGimbalController.mouseDragStart(_pressX, _pressY)
133 cameraTrackingController.mouseDragStart(_pressX, _pressY)
136 onScreenGimbalController.mouseDragPositionChanged(mouse.x, mouse.y)
137 cameraTrackingController.mouseDragPositionChanged(mouse.x, mouse.y)
141 onReleased: (mouse) => {
143 onScreenGimbalController.mouseDragEnd()
144 cameraTrackingController.mouseDragEnd(mouse.x, mouse.y)
145 } else if (_doubleClicked) {
146 // Second release of a double-click - fullscreen toggle already handled
147 _doubleClicked = false
149 singleClickTimer.clickX = mouse.x
150 singleClickTimer.clickY = mouse.y
151 singleClickTimer.restart()
157 ProximityRadarVideoView{
159 vehicle: QGroundControl.multiVehicleManager.activeVehicle
162 ObstacleDistanceOverlayVideo {
164 showText: pipState.state === pipState.fullState