|
|
|
/*=====================================================================
|
|
|
|
|
|
|
|
QGroundControl Open Source Ground Control Station
|
|
|
|
|
|
|
|
(c) 2009, 2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
|
|
|
|
|
|
|
This file is part of the QGROUNDCONTROL project
|
|
|
|
|
|
|
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QGROUNDCONTROL is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
======================================================================*/
|
|
|
|
|
|
|
|
import QtQuick 2.5
|
|
|
|
import QtQuick.Controls 1.3
|
|
|
|
|
|
|
|
import QGroundControl 1.0
|
|
|
|
import QGroundControl.ScreenTools 1.0
|
|
|
|
import QGroundControl.Controls 1.0
|
|
|
|
import QGroundControl.Palette 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: pip
|
|
|
|
|
|
|
|
property bool isHidden: false
|
|
|
|
property bool isDark: false
|
|
|
|
|
|
|
|
signal activated()
|
|
|
|
signal hideIt(bool state)
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
enabled: !isHidden
|
|
|
|
onClicked: {
|
|
|
|
pip.activated()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-- PIP Corner Indicator
|
|
|
|
Image {
|
|
|
|
id: closePIP
|
|
|
|
source: "/qmlimages/PiP.svg"
|
|
|
|
mipmap: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
visible: !isHidden
|
|
|
|
height: ScreenTools.defaultFontPixelHeight * 2.5
|
|
|
|
width: ScreenTools.defaultFontPixelHeight * 2.5
|
|
|
|
sourceSize.height: height
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
pip.hideIt(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-- Show PIP
|
|
|
|
Rectangle {
|
|
|
|
id: openPIP
|
|
|
|
anchors.left : parent.left
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
height: ScreenTools.defaultFontPixelHeight * 2
|
|
|
|
width: ScreenTools.defaultFontPixelHeight * 2
|
|
|
|
radius: ScreenTools.defaultFontPixelHeight / 3
|
|
|
|
visible: isHidden
|
|
|
|
color: isDark ? Qt.rgba(0,0,0,0.75) : Qt.rgba(0,0,0,0.5)
|
|
|
|
Image {
|
|
|
|
width: parent.width * 0.75
|
|
|
|
height: parent.height * 0.75
|
|
|
|
sourceSize.height: height
|
|
|
|
source: "/res/buttonRight.svg"
|
|
|
|
mipmap: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
pip.hideIt(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|