From 0337a5a351e2517d313af48392f3004eb32ebfaa Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Thu, 16 Mar 2017 13:05:52 -0400 Subject: [PATCH] Allow resizing pip window --- src/FlightDisplay/FlightDisplayView.qml | 18 ++++++++++++++++ src/QmlControls/QGCPipable.qml | 28 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index 4114f9e51..25e541d96 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -311,6 +311,24 @@ QGCView { onHideIt: { setPipVisibility(!state) } + onBigger: { + if (_pipSize >= 825) { + return + } + + _pipSize += 50 + _flightVideoPipControl.width = _pipSize + _flightVideoPipControl.height= _pipSize * (9/16) + } + onSmaller: { + if (_pipSize <= 225) { + return + } + + _pipSize -= 50 + _flightVideoPipControl.width = _pipSize + _flightVideoPipControl.height= _pipSize * (9/16) + } } Row { diff --git a/src/QmlControls/QGCPipable.qml b/src/QmlControls/QGCPipable.qml index 2294835a0..a955b2438 100644 --- a/src/QmlControls/QGCPipable.qml +++ b/src/QmlControls/QGCPipable.qml @@ -24,6 +24,8 @@ Item { signal activated() signal hideIt(bool state) + signal bigger() + signal smaller() MouseArea { anchors.fill: parent @@ -33,6 +35,32 @@ Item { } } + QGCButton { + id: largerButton + visible: !isHidden + anchors.left: parent.left + anchors.bottom: smallerButton.top + height: 20 + width: height + anchors.margins: 5 + text: "+" + opacity: 0.5 + onClicked: pip.bigger() + } + + QGCButton { + id: smallerButton + visible: !isHidden + anchors.left: parent.left + anchors.bottom: closePIP.top + height: 20 + width: height + anchors.margins: 5 + text: "-" + opacity: 0.5 + onClicked: pip.smaller() + } + //-- PIP Corner Indicator Image { id: closePIP -- 2.22.0