4import QGroundControl.Controls
5import QGroundControl.VideoManager
11 /// Height the Fly View toolbar covers at the top of the full-size video.
12 property real topInset: 0
13 /// Width the Fly View's widgets cover at the top right of the full-size video.
14 property real rightInset: 0
15 property Item pipState: videoPipState
16 /// The manager whose video the view shows.
17 property VideoManager videoManager: QGroundControl.videoManager
25 if (videoPipState.state !== videoPipState.fullState) {
26 root.videoManager.fullScreen = false
35 useSmallFont: root.pipState.state !== root.pipState.fullState
36 thermalPipTopInset: root.pipState.state === root.pipState.fullState ? root.topInset : 0
37 showTiles: root.pipState.state === root.pipState.fullState
38 tilesRightInset: root.rightInset
39 videoManager: root.videoManager
40 visible: root.videoManager.isStreamSource || root.videoManager.isUvc
44 text: qsTr("Double-click to exit full screen")
45 font.pointSize: ScreenTools.largeFontPointSize
46 visible: root.videoManager.fullScreen
47 anchors.centerIn: parent
51 labelAnimation.start()
55 PropertyAnimation on opacity {
60 easing.type: Easing.InExpo
64 OnScreenGimbalController {
65 id: onScreenGimbalController
67 cameraTrackingEnabled: !!(videoStreaming.camera && videoStreaming.camera.trackingEnabled)
70 OnScreenCameraTrackingController {
71 id: cameraTrackingController
73 camera: videoStreaming.camera
74 videoWidth: videoStreaming.videoWidth
75 videoHeight: videoStreaming.videoHeight
79 id: flyViewVideoMouseArea
81 property real _pressX: 0
82 property real _pressY: 0
83 property bool _dragging: false
84 property bool _doubleClicked: false
85 readonly property real _dragThreshold: 10
88 enabled: root.pipState.state === root.pipState.fullState
90 // Defer single-click handling so a double-click (fullscreen toggle) doesn't also
91 // fire an unintended gimbal click-to-point/tracking command on its first click.
95 property real clickX: 0
96 property real clickY: 0
98 interval: Qt.styleHints.mouseDoubleClickInterval
102 onScreenGimbalController.mouseClicked(clickX, clickY)
103 cameraTrackingController.mouseClicked(clickX, clickY)
107 onDoubleClicked: (mouse) => {
108 if (videoStreaming.tileAt(mouse.x, mouse.y)) {
109 mouse.accepted = false
112 // Fires on the second press of a double-click. The second release still emits
113 // onReleased, so flag it to prevent re-arming the single-click timer.
114 _doubleClicked = true
115 singleClickTimer.stop()
116 root.videoManager.fullScreen = !root.videoManager.fullScreen
119 onPressed: (mouse) => {
120 // A press on a video tile is the tile's, which is below this area.
121 if (videoStreaming.tileAt(mouse.x, mouse.y)) {
122 mouse.accepted = false
128 // Clear any stale flag (e.g. double-click followed by drag releases through the
129 // drag branch without consuming it). Safe: pressed is emitted before doubleClicked.
130 _doubleClicked = false
133 onPositionChanged: (mouse) => {
134 if (!_dragging && (Math.abs(mouse.x - _pressX) >= _dragThreshold || Math.abs(mouse.y - _pressY) >= _dragThreshold)) {
136 onScreenGimbalController.mouseDragStart(_pressX, _pressY)
137 cameraTrackingController.mouseDragStart(_pressX, _pressY)
140 onScreenGimbalController.mouseDragPositionChanged(mouse.x, mouse.y)
141 cameraTrackingController.mouseDragPositionChanged(mouse.x, mouse.y)
145 onReleased: (mouse) => {
147 onScreenGimbalController.mouseDragEnd()
148 cameraTrackingController.mouseDragEnd(mouse.x, mouse.y)
149 } else if (_doubleClicked) {
150 // Second release of a double-click - fullscreen toggle already handled
151 _doubleClicked = false
153 singleClickTimer.clickX = mouse.x
154 singleClickTimer.clickY = mouse.y
155 singleClickTimer.restart()
161 ProximityRadarVideoView{
163 vehicle: QGroundControl.multiVehicleManager.activeVehicle
166 ObstacleDistanceOverlayVideo {
168 showText: root.pipState.state === root.pipState.fullState