Commit 081d2ee9 authored by Gus Grubba's avatar Gus Grubba

Toggle video stream full screen

parent ac99b3fe
......@@ -222,7 +222,7 @@ QGCView {
z: _mainIsMap ? _panel.z + 1 : _panel.z + 2
anchors.left: _panel.left
anchors.bottom: _panel.bottom
visible: _mainIsMap || _isPipVisible
visible: _mainIsMap || _isPipVisible && !QGroundControl.videoManager.fullScreen
width: _mainIsMap ? _panel.width : _pipSize
height: _mainIsMap ? _panel.height : _pipSize * (9/16)
states: [
......@@ -300,7 +300,7 @@ QGCView {
anchors.left: _panel.left
anchors.bottom: _panel.bottom
anchors.margins: ScreenTools.defaultFontPixelHeight
visible: QGroundControl.videoManager.hasVideo
visible: QGroundControl.videoManager.hasVideo && !QGroundControl.videoManager.fullScreen
isHidden: !_isPipVisible
isDark: isBackgroundDark
onActivated: {
......@@ -349,7 +349,7 @@ QGCView {
qgcView: root
useLightColors: isBackgroundDark
missionController: _missionController
visible: singleVehicleView.checked
visible: singleVehicleView.checked && !QGroundControl.videoManager.fullScreen
}
//-------------------------------------------------------------------------
......@@ -357,6 +357,7 @@ QGCView {
Loader {
id: flyViewOverlay
z: flightDisplayViewWidgets.z + 1
visible: !QGroundControl.videoManager.fullScreen
height: ScreenTools.availableHeight
anchors.left: parent.left
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
......@@ -373,7 +374,7 @@ QGCView {
anchors.right: _flightVideo.right
height: ScreenTools.defaultFontPixelHeight * 2
width: height
visible: QGroundControl.videoManager.videoReceiver.videoRunning && QGroundControl.settingsManager.videoSettings.showRecControl.rawValue && !_isCamera
visible: QGroundControl.videoManager.videoReceiver.videoRunning && QGroundControl.settingsManager.videoSettings.showRecControl.rawValue && !_isCamera && !QGroundControl.videoManager.fullScreen
opacity: 0.75
Rectangle {
......@@ -407,7 +408,7 @@ QGCView {
anchors.right: parent.right
anchors.bottom: parent.bottom
width: ScreenTools.defaultFontPixelWidth * 30
visible: !singleVehicleView.checked
visible: !singleVehicleView.checked && !QGroundControl.videoManager.fullScreen
z: _panel.z + 4
}
......@@ -418,7 +419,7 @@ QGCView {
z: _panel.z + 5
width: parent.width - (_flightVideoPipControl.width / 2)
height: Math.min(ScreenTools.availableHeight * 0.25, ScreenTools.defaultFontPixelWidth * 16)
visible: _virtualJoystick ? _virtualJoystick.value : false
visible: (_virtualJoystick ? _virtualJoystick.value : false) && !QGroundControl.videoManager.fullScreen
anchors.bottom: _flightVideoPipControl.top
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2
anchors.horizontalCenter: flightDisplayViewWidgets.horizontalCenter
......@@ -431,7 +432,7 @@ QGCView {
}
ToolStrip {
visible: _activeVehicle ? _activeVehicle.guidedModeSupported : true
visible: (_activeVehicle ? _activeVehicle.guidedModeSupported : true) && !QGroundControl.videoManager.fullScreen
id: toolStrip
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.left: _panel.left
......
......@@ -39,6 +39,12 @@ Item {
font.pointSize: _mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
}
}
}
Rectangle {
anchors.fill: parent
......@@ -67,35 +73,41 @@ Item {
height: parent.height
width: 1
x: parent.width * 0.33
visible: _showGrid
visible: _showGrid && !QGroundControl.videoManager.fullScreen
}
Rectangle {
color: Qt.rgba(1,1,1,0.5)
height: parent.height
width: 1
x: parent.width * 0.66
visible: _showGrid
visible: _showGrid && !QGroundControl.videoManager.fullScreen
}
Rectangle {
color: Qt.rgba(1,1,1,0.5)
width: parent.width
height: 1
y: parent.height * 0.33
visible: _showGrid
visible: _showGrid && !QGroundControl.videoManager.fullScreen
}
Rectangle {
color: Qt.rgba(1,1,1,0.5)
width: parent.width
height: 1
y: parent.height * 0.66
visible: _showGrid
visible: _showGrid && !QGroundControl.videoManager.fullScreen
}
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
}
}
}
//-- Camera Controller
Loader {
source: _dynamicCameras ? _dynamicCameras.controllerSource : ""
visible: !_mainIsMap && _dynamicCameras && _dynamicCameras.cameras.count && _connected
source: QGroundControl.videoManager.fullScreen ? "" : (_dynamicCameras ? _dynamicCameras.controllerSource : "")
visible: !_mainIsMap && _dynamicCameras && _dynamicCameras.cameras.count && _connected && !QGroundControl.videoManager.fullScreen
anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.bottom: parent.bottom
......
......@@ -34,6 +34,7 @@ VideoManager::VideoManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app, toolbox)
, _videoReceiver(NULL)
, _videoSettings(NULL)
, _fullScreen(false)
{
}
......
......@@ -35,10 +35,12 @@ public:
Q_PROPERTY(bool isGStreamer READ isGStreamer NOTIFY isGStreamerChanged)
Q_PROPERTY(QString videoSourceID READ videoSourceID NOTIFY videoSourceIDChanged)
Q_PROPERTY(bool uvcEnabled READ uvcEnabled CONSTANT)
Q_PROPERTY(bool fullScreen READ fullScreen WRITE setfullScreen NOTIFY fullScreenChanged)
Q_PROPERTY(VideoReceiver* videoReceiver READ videoReceiver CONSTANT)
bool hasVideo ();
bool isGStreamer ();
bool fullScreen () { return _fullScreen; }
QString videoSourceID () { return _videoSourceID; }
VideoReceiver* videoReceiver () { return _videoReceiver; }
......@@ -49,6 +51,8 @@ public:
bool uvcEnabled ();
#endif
void setfullScreen (bool f) { _fullScreen = f; emit fullScreenChanged(); }
// Override from QGCTool
void setToolbox (QGCToolbox *toolbox);
......@@ -56,6 +60,7 @@ signals:
void hasVideoChanged ();
void isGStreamerChanged ();
void videoSourceIDChanged ();
void fullScreenChanged ();
private slots:
void _videoSourceChanged ();
......@@ -69,6 +74,7 @@ private:
VideoReceiver* _videoReceiver;
VideoSettings* _videoSettings;
QString _videoSourceID;
bool _fullScreen;
};
#endif
......@@ -204,7 +204,7 @@ Item {
property var messageQueue: []
function showMessage(message) {
if(criticalMmessageArea.visible) {
if(criticalMmessageArea.visible || QGroundControl.videoManager.fullScreen) {
messageQueue.push(message)
} else {
criticalMessageText.text = message
......@@ -271,6 +271,7 @@ Item {
MainToolBar {
id: toolBar
height: ScreenTools.toolbarHeight
visible: !QGroundControl.videoManager.fullScreen
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
......@@ -593,7 +594,7 @@ Item {
//-- Loader helper for any child, no matter how deep can display an element
// in the middle of the main window.
Loader {
id: rootLoader
id: rootLoader
anchors.centerIn: parent
}
......
......@@ -21,6 +21,7 @@ import QGroundControl.Controllers 1.0
Rectangle {
id: toolBar
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.8) : Qt.rgba(0,0,0,0.75)
visible: !QGroundControl.videoManager.fullScreen
QGCPalette { id: qgcPal; colorGroupEnabled: true }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment