Commit ec4484f8 authored by Patrick José Pereira's avatar Patrick José Pereira

Add video popup

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 6a75949d
......@@ -109,6 +109,7 @@
<file alias="compassInstrumentDial.svg">src/FlightMap/Images/compassInstrumentDial.svg</file>
<file alias="crossHair.svg">src/FlightMap/Images/crossHair.svg</file>
<file alias="PiP.svg">src/FlightMap/Images/PiP.svg</file>
<file alias="pipHide.svg">src/FlightMap/Images/pipHide.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
......
......@@ -16,6 +16,7 @@ import QtLocation 5.3
import QtPositioning 5.3
import QtMultimedia 5.5
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import QGroundControl 1.0
import QGroundControl.FlightDisplay 1.0
......@@ -182,6 +183,24 @@ QGCView {
}
}
Window {
id: videoWindow
width: !_mainIsMap ? _panel.width : _pipSize
height: !_mainIsMap ? _panel.height : _pipSize * (9/16)
visible: false
Item {
id: videoItem
anchors.fill: parent
}
onClosing: {
_flightVideo.state = "unpopup"
videoWindow.visible = false
}
}
QGCMapPalette { id: mapPal; lightColors: _mainIsMap ? _flightMap.isSatelliteMap : true }
QGCViewPanel {
......@@ -242,7 +261,11 @@ QGCView {
name: "pipMode"
PropertyChanges {
target: _flightVideo
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelHeight
}
PropertyChanges {
target: _flightVideoPipControl
inPopup: false
}
},
State {
......@@ -251,10 +274,53 @@ QGCView {
target: _flightVideo
anchors.margins: 0
}
PropertyChanges {
target: _flightVideoPipControl
inPopup: false
}
},
State {
name: "popup"
StateChangeScript {
script: QGroundControl.videoManager.stopVideo()
}
ParentChange {
target: _flightVideo
parent: videoItem
x: 0
y: 0
width: videoWindow.width
height: videoWindow.height
}
PropertyChanges {
target: _flightVideoPipControl
inPopup: true
}
},
State {
name: "unpopup"
StateChangeScript {
script: QGroundControl.videoManager.stopVideo()
}
ParentChange {
target: _flightVideo
parent: _panel
}
PropertyChanges {
target: _flightVideo
anchors.left: _panel.left
anchors.bottom: _panel.bottom
anchors.margins: ScreenTools.defaultFontPixelHeight
}
PropertyChanges {
target: _flightVideoPipControl
inPopup: false
}
}
]
//-- Video Streaming
FlightDisplayViewVideo {
id: videoStreaming
anchors.fill: parent
visible: QGroundControl.videoManager.isGStreamer
}
......@@ -285,6 +351,10 @@ QGCView {
onHideIt: {
setPipVisibility(!state)
}
onPopup: {
videoWindow.visible = true
_flightVideo.state = "popup"
}
onNewWidth: {
_pipSize = newWidth
}
......
......@@ -56,6 +56,9 @@ public:
// Override from QGCTool
void setToolbox (QGCToolbox *toolbox);
Q_INVOKABLE void startVideo() {_videoReceiver->stop();};
Q_INVOKABLE void stopVideo() {_videoReceiver->stop();};
signals:
void hasVideoChanged ();
void isGStreamerChanged ();
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<path opacity="0.5" d="M0,0v72h72C72,32.203,39.797,0,0,0z"/>
<g>
<rect x="14.4" y="29.599" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" width="36" height="27"/>
<rect x="5.4" y="38.599" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" width="36" height="27"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 72 72"
enable-background="new 0 0 72 72"
xml:space="preserve"
sodipodi:docname="PiP.svg"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"><metadata
id="metadata15"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs13" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1025"
id="namedview11"
showgrid="false"
inkscape:zoom="9.2709556"
inkscape:cx="30.815469"
inkscape:cy="35.758524"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><path
d="M 72,0 H 0 V 72 C 39.797,72 72,39.797 72,0 Z"
id="path2"
inkscape:connector-curvature="0"
style="opacity:0.5" /><g
id="g8"
transform="translate(3.932506,-20.925567)"><rect
x="14.4"
y="29.599001"
stroke-miterlimit="10"
width="36"
height="27"
id="rect4"
style="stroke:#ffffff;stroke-width:2;stroke-miterlimit:10" /><rect
x="5.4000001"
y="38.598999"
stroke-miterlimit="10"
width="36"
height="27"
id="rect6"
style="stroke:#ffffff;stroke-width:2;stroke-miterlimit:10" /></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 78.389456 80.079444"
height="80.079445"
width="78.389458"
version="1.1"
id="svg2"
sodipodi:docname="pipHide.svg"
inkscape:version="0.92.2 5c3e80d, 2017-08-06">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1025"
id="namedview6"
showgrid="false"
inkscape:zoom="5.6568543"
inkscape:cx="29.512391"
inkscape:cy="16.118589"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6" />
<path
style="stroke-width:0.11996762;fill:none"
d="M 0.09494398,40.463469 V 0.92756689 L 1.7444988,1.0005818 c 2.6211635,0.1160216 5.1781695,0.2929624 6.0883569,0.4213048 0.4618754,0.065127 1.6765476,0.2290098 2.6992713,0.3641829 3.125976,0.4131596 7.301401,1.3016931 10.497167,2.2338051 11.943701,3.4836293 22.623948,9.5364434 31.611469,17.9151594 1.084676,1.0112 2.65908,2.586829 4.198867,4.202128 1.443535,1.514327 3.729238,4.282314 5.305217,6.424615 6.520629,8.863801 10.9711,18.583478 13.453719,29.382467 1.097203,4.772658 1.860941,11.297842 1.871039,15.985686 l 0.0045,2.069442 H 38.784503 0.09494398 Z M 59.545208,62.181007 c 0.363637,-0.224845 0.725417,-0.586549 0.950263,-0.95006 l 0.363075,-0.586989 0.04034,-3.089978 c 0.04862,-3.724653 -0.02427,-4.220064 -0.734291,-4.990344 -0.891002,-0.966622 0.289767,-0.884659 -15.321724,-1.063557 -7.686926,-0.08809 -14.651046,-0.163088 -15.475824,-0.166668 l -1.499595,-0.0065 -0.03537,-3.688901 c -0.01945,-2.02889 -0.05807,-4.984546 -0.08581,-6.568118 -0.02774,-1.583573 -0.08351,-6.793167 -0.123931,-11.576876 -0.08193,-9.696337 -0.0718,-9.574447 -0.859382,-10.341914 -0.810803,-0.790091 -0.954735,-0.815075 -4.69543,-0.815075 -3.735905,0 -3.850018,0.01973 -4.678787,0.808889 -0.309166,0.294389 -0.524328,0.638057 -0.620205,0.990625 -0.214493,0.788749 -0.08575,39.922882 0.133506,40.582444 0.08288,0.249301 0.338981,0.647158 0.569123,0.884128 0.847492,0.872635 0.03415,0.815036 12.495722,0.884918 6.169335,0.0346 15.21616,0.06159 20.104056,0.05998 l 8.887082,-0.0029 0.587188,-0.363075 z"
id="path12"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke-width:0.11996762"
d="M 0.09494398,40.463469 V 0.92756689 L 1.7444988,1.0005818 c 2.6211635,0.1160216 5.1781695,0.2929624 6.0883569,0.4213048 0.4618754,0.065127 1.6765476,0.2290098 2.6992713,0.3641829 3.125976,0.4131596 7.301401,1.3016931 10.497167,2.2338051 11.943701,3.4836293 22.623948,9.5364434 31.611469,17.9151594 1.084676,1.0112 2.65908,2.586829 4.198867,4.202128 1.443535,1.514327 3.729238,4.282314 5.305217,6.424615 6.520629,8.863801 10.9711,18.583478 13.453719,29.382467 1.097203,4.772658 1.860941,11.297842 1.871039,15.985686 l 0.0045,2.069442 H 38.784503 0.09494398 Z M 59.545208,62.181007 c 0.363637,-0.224845 0.725417,-0.586549 0.950263,-0.95006 l 0.363075,-0.586989 0.04034,-3.089978 c 0.04862,-3.724653 -0.02427,-4.220064 -0.734291,-4.990344 -0.891002,-0.966622 0.289767,-0.884659 -15.321724,-1.063557 -7.686926,-0.08809 -14.651046,-0.163088 -15.475824,-0.166668 l -1.499595,-0.0065 -0.03537,-3.688901 c -0.01945,-2.02889 -0.05807,-4.984546 -0.08581,-6.568118 -0.02774,-1.583573 -0.08351,-6.793167 -0.123931,-11.576876 -0.08193,-9.696337 -0.0718,-9.574447 -0.859382,-10.341914 -0.810803,-0.790091 -0.954735,-0.815075 -4.69543,-0.815075 -3.735905,0 -3.850018,0.01973 -4.678787,0.808889 -0.309166,0.294389 -0.524328,0.638057 -0.620205,0.990625 -0.214493,0.788749 -0.08575,39.922882 0.133506,40.582444 0.08288,0.249301 0.338981,0.647158 0.569123,0.884128 0.847492,0.872635 0.03415,0.815036 12.495722,0.884918 6.169335,0.0346 15.21616,0.06159 20.104056,0.05998 l 8.887082,-0.0029 0.587188,-0.363075 z"
id="path14"
inkscape:connector-curvature="0" />
<path
d="M -0.00690656,1.0194242 V 80.091229 H 78.351378 c 0,-43.70584 -35.046831,-79.0718048 -78.35828456,-79.0718048 z"
id="path2"
inkscape:connector-curvature="0"
style="opacity:0.5;stroke-width:1.09325325" />
<polyline
transform="matrix(0.82528393,0,0,0.64905228,0.94504266,30.699404)"
style="fill:none;stroke:#ffffff;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10"
stroke-miterlimit="10"
points=" 26.424,7.552 10,36 26.424,64.448 "
id="polyline34" />
<polyline
transform="matrix(0.82528393,0,0,0.64905228,0.94504266,30.699404)"
style="fill:none;stroke:#ffffff;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10"
stroke-miterlimit="10"
points=" 45.212,7.552 28.788,36 45.212,64.448 "
id="polyline36" />
<polyline
transform="matrix(0.82528393,0,0,0.64905228,0.94504266,30.699404)"
style="fill:none;stroke:#ffffff;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10"
stroke-miterlimit="10"
points=" 64,7.552 47.576,36 64,64.448 "
id="polyline38" />
</svg>
......@@ -26,9 +26,12 @@ Item {
property real maxSize: 0.75
property real minSize: 0.10
property bool inPopup: false
signal activated()
signal hideIt(bool state)
signal newWidth(real newWidth)
signal popup()
MouseArea {
id: pipMouseArea
......@@ -87,7 +90,7 @@ Item {
mipmap: true
anchors.right: parent.right
anchors.top: parent.top
visible: !isHidden && (ScreenTools.isMobile || pipMouseArea.containsMouse)
visible: !isHidden && (ScreenTools.isMobile || pipMouseArea.containsMouse) && !inPopup
height: ScreenTools.defaultFontPixelHeight * 2.5
width: ScreenTools.defaultFontPixelHeight * 2.5
sourceSize.height: height
......@@ -116,10 +119,31 @@ Item {
}
}
//-- PIP Popup Indicator
Image {
id: popupPIP
source: "/qmlimages/PiP.svg"
mipmap: true
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
anchors.top: parent.top
visible: !isHidden && (ScreenTools.isMobile || pipMouseArea.containsMouse) && !inPopup && !ScreenTools.isMobile
height: ScreenTools.defaultFontPixelHeight * 2.5
width: ScreenTools.defaultFontPixelHeight * 2.5
sourceSize.height: height
MouseArea {
anchors.fill: parent
onClicked: {
inPopup = true
pip.popup()
}
}
}
//-- PIP Corner Indicator
Image {
id: closePIP
source: "/qmlimages/PiP.svg"
source: "/qmlimages/pipHide.svg"
mipmap: true
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
......
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