Browse Source
* AirmapUI: Restore expanded state when enabling AirMap AirMap Settings Control on Fly View Eliminated flight widget "states" Define flight widget top margin (plugin options) Add expand icon Expand/Colapse Controllers Adjust colors Remove unused image Initial Mockup # Conflicts: # src/Settings/AppSettings.cc # src/Settings/AppSettings.hQGC4.4
27 changed files with 981 additions and 277 deletions
@ -0,0 +1,195 @@
@@ -0,0 +1,195 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> |
||||
* |
||||
* QGroundControl is licensed according to the terms in the file |
||||
* COPYING.md in the root of the source code directory. |
||||
* |
||||
****************************************************************************/ |
||||
|
||||
|
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 1.2 |
||||
import QtQuick.Controls.Styles 1.4 |
||||
import QtQuick.Dialogs 1.2 |
||||
import QtMultimedia 5.5 |
||||
import QtQuick.Layouts 1.2 |
||||
|
||||
import QGroundControl 1.0 |
||||
import QGroundControl.FactSystem 1.0 |
||||
import QGroundControl.FactControls 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.MultiVehicleManager 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
import QGroundControl.Controllers 1.0 |
||||
import QGroundControl.SettingsManager 1.0 |
||||
|
||||
QGCView { |
||||
id: _qgcView |
||||
viewPanel: panel |
||||
color: qgcPal.window |
||||
anchors.fill: parent |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
|
||||
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 20 |
||||
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 30 |
||||
property real _panelWidth: _qgcView.width * _internalWidthRatio |
||||
property Fact _enableAirMapFact: QGroundControl.settingsManager.appSettings.enableAirMap |
||||
property bool _airMapEnabled: _enableAirMapFact.rawValue |
||||
|
||||
readonly property real _internalWidthRatio: 0.8 |
||||
|
||||
QGCPalette { id: qgcPal } |
||||
|
||||
QGCViewPanel { |
||||
id: panel |
||||
anchors.fill: parent |
||||
QGCFlickable { |
||||
clip: true |
||||
anchors.fill: parent |
||||
contentHeight: settingsColumn.height |
||||
contentWidth: settingsColumn.width |
||||
Column { |
||||
id: settingsColumn |
||||
width: _qgcView.width |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
//----------------------------------------------------------------- |
||||
//-- General |
||||
Item { |
||||
width: _panelWidth |
||||
height: generalLabel.height |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
visible: QGroundControl.settingsManager.unitsSettings.visible |
||||
QGCLabel { |
||||
id: generalLabel |
||||
text: qsTr("General") |
||||
font.family: ScreenTools.demiboldFontFamily |
||||
} |
||||
} |
||||
Rectangle { |
||||
height: generalCol.height + (ScreenTools.defaultFontPixelHeight * 2) |
||||
width: _panelWidth |
||||
color: qgcPal.windowShade |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
Column { |
||||
id: generalCol |
||||
spacing: ScreenTools.defaultFontPixelWidth |
||||
anchors.centerIn: parent |
||||
FactCheckBox { |
||||
text: qsTr("Enable AirMap Services") |
||||
fact: _enableAirMapFact |
||||
visible: _enableAirMapFact.visible |
||||
} |
||||
QGCCheckBox { |
||||
text: qsTr("Disable Telemetry") |
||||
checked: false |
||||
enabled: _airMapEnabled |
||||
onClicked: |
||||
{ |
||||
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
//----------------------------------------------------------------- |
||||
//-- Login / Registration |
||||
Item { |
||||
width: _panelWidth |
||||
height: loginLabel.height |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
visible: QGroundControl.settingsManager.appSettings.visible |
||||
QGCLabel { |
||||
id: loginLabel |
||||
text: qsTr("Login / Registration") |
||||
font.family: ScreenTools.demiboldFontFamily |
||||
} |
||||
} |
||||
Rectangle { |
||||
height: loginGrid.height + (ScreenTools.defaultFontPixelHeight * 2) |
||||
width: _panelWidth |
||||
color: qgcPal.windowShade |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
GridLayout { |
||||
id: loginGrid |
||||
columns: 2 |
||||
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.25 |
||||
anchors.centerIn: parent |
||||
QGCLabel { text: qsTr("Email:") } |
||||
QGCTextField { |
||||
width: _editFieldWidth |
||||
enabled: _airMapEnabled |
||||
} |
||||
QGCLabel { text: qsTr("Password:") } |
||||
QGCTextField { |
||||
width: _editFieldWidth |
||||
enabled: _airMapEnabled |
||||
} |
||||
Item { |
||||
width: 1 |
||||
height: 1 |
||||
Layout.columnSpan: 2 |
||||
} |
||||
QGCLabel { |
||||
text: qsTr("Forgot Your AirMap Password?") |
||||
Layout.alignment: Qt.AlignHCenter |
||||
Layout.columnSpan: 2 |
||||
} |
||||
Item { |
||||
width: 1 |
||||
height: 1 |
||||
Layout.columnSpan: 2 |
||||
} |
||||
QGCButton { |
||||
text: qsTr("Register for an AirMap Account") |
||||
Layout.alignment: Qt.AlignHCenter |
||||
Layout.columnSpan: 2 |
||||
enabled: _airMapEnabled |
||||
} |
||||
} |
||||
} |
||||
//----------------------------------------------------------------- |
||||
//-- Pilot Profile |
||||
Item { |
||||
width: _panelWidth |
||||
height: profileLabel.height |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
visible: QGroundControl.settingsManager.appSettings.visible |
||||
QGCLabel { |
||||
id: profileLabel |
||||
text: qsTr("Pilot Profile") |
||||
font.family: ScreenTools.demiboldFontFamily |
||||
} |
||||
} |
||||
Rectangle { |
||||
height: profileGrid.height + (ScreenTools.defaultFontPixelHeight * 2) |
||||
width: _panelWidth |
||||
color: qgcPal.windowShade |
||||
anchors.margins: ScreenTools.defaultFontPixelWidth |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
GridLayout { |
||||
id: profileGrid |
||||
columns: 2 |
||||
columnSpacing: ScreenTools.defaultFontPixelHeight * 2 |
||||
rowSpacing: ScreenTools.defaultFontPixelWidth * 0.25 |
||||
anchors.centerIn: parent |
||||
QGCLabel { text: qsTr("Name:") } |
||||
QGCLabel { text: qsTr("John Doe") } |
||||
QGCLabel { text: qsTr("User Name:") } |
||||
QGCLabel { text: qsTr("joe36") } |
||||
QGCLabel { text: qsTr("Email:") } |
||||
QGCLabel { text: qsTr("jonh@doe.com") } |
||||
QGCLabel { text: qsTr("Phone:") } |
||||
QGCLabel { text: qsTr("+1 212 555 1212") } |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,259 @@
@@ -0,0 +1,259 @@
|
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 1.2 |
||||
import QtQuick.Controls.Styles 1.4 |
||||
import QtQuick.Dialogs 1.2 |
||||
import QtQuick.Layouts 1.2 |
||||
import QtQml 2.2 |
||||
|
||||
import QGroundControl 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.Vehicle 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.FactControls 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
import QGroundControl.Airmap 1.0 |
||||
|
||||
Item { |
||||
id: _root |
||||
width: parent.width |
||||
height: colapsed ? colapsedRect.height : expandedRect.height |
||||
|
||||
property bool colapsed: true |
||||
property bool showColapse: true |
||||
|
||||
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
readonly property color _colorOrange: "#d75e0d" |
||||
readonly property color _colorBrown: "#3c2b24" |
||||
readonly property color _colorLightBrown: "#5a4e49" |
||||
readonly property color _colorGray: "#615c61" |
||||
readonly property color _colorMidBrown: "#3a322f" |
||||
readonly property color _colorYellow: "#d7c61d" |
||||
readonly property color _colorWhite: "#ffffff" |
||||
|
||||
QGCPalette { |
||||
id: qgcPal |
||||
colorGroupEnabled: enabled |
||||
} |
||||
|
||||
//--------------------------------------------------------------- |
||||
//-- Colapsed State |
||||
Rectangle { |
||||
id: colapsedRect |
||||
width: parent.width |
||||
height: colapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0 |
||||
color: _colorOrange |
||||
radius: _radius |
||||
visible: colapsed |
||||
Row { |
||||
id: colapsedRow |
||||
spacing: ScreenTools.defaultFontPixelWidth |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
QGCColoredImage { |
||||
width: height |
||||
height: ScreenTools.defaultFontPixelWidth * 2.5 |
||||
sourceSize.height: height |
||||
source: "qrc:/airmap/advisory-icon.svg" |
||||
color: _colorWhite |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
} |
||||
QGCLabel { |
||||
text: qsTr("Airspace") |
||||
color: _colorWhite |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
} |
||||
} |
||||
QGCColoredImage { |
||||
width: height |
||||
height: ScreenTools.defaultFontPixelWidth * 2.5 |
||||
sourceSize.height: height |
||||
source: "qrc:/airmap/expand.svg" |
||||
color: _colorWhite |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
} |
||||
MouseArea { |
||||
anchors.fill: parent |
||||
onClicked: colapsed = false |
||||
} |
||||
} |
||||
//--------------------------------------------------------------- |
||||
//-- Expanded State |
||||
Rectangle { |
||||
id: expandedRect |
||||
width: parent.width |
||||
height: !colapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0 |
||||
color: _colorOrange |
||||
radius: _radius |
||||
visible: !colapsed |
||||
Column { |
||||
id: expandedCol |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
anchors.left: parent.left |
||||
anchors.right: parent.right |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
//-- Header |
||||
Item { |
||||
height: expandedRow.height |
||||
anchors.left: parent.left |
||||
anchors.right: parent.right |
||||
Row { |
||||
id: expandedRow |
||||
spacing: ScreenTools.defaultFontPixelWidth |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth |
||||
QGCColoredImage { |
||||
width: height |
||||
height: ScreenTools.defaultFontPixelWidth * 2.5 |
||||
sourceSize.height: height |
||||
source: "qrc:/airmap/advisory-icon.svg" |
||||
color: _colorWhite |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
} |
||||
Column { |
||||
spacing: 0 |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
QGCLabel { |
||||
text: qsTr("Airspace") |
||||
color: _colorWhite |
||||
} |
||||
QGCLabel { |
||||
text: qsTr("3 Advisories") |
||||
color: _colorWhite |
||||
font.pointSize: ScreenTools.smallFontPointSize |
||||
} |
||||
} |
||||
} |
||||
QGCColoredImage { |
||||
width: height |
||||
height: ScreenTools.defaultFontPixelWidth * 2.5 |
||||
sourceSize.height: height |
||||
source: "qrc:/airmap/colapse.svg" |
||||
color: _colorWhite |
||||
visible: showColapse |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
MouseArea { |
||||
anchors.fill: parent |
||||
enabled: showColapse |
||||
onClicked: colapsed = true |
||||
} |
||||
} |
||||
} |
||||
//-- Contents (Brown Box) |
||||
Rectangle { |
||||
color: _colorBrown |
||||
height: airspaceCol.height + ScreenTools.defaultFontPixelHeight |
||||
radius: _radius |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
Column { |
||||
id: airspaceCol |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
//-- Regulations |
||||
Rectangle { |
||||
color: _colorLightBrown |
||||
height: regCol.height + ScreenTools.defaultFontPixelHeight |
||||
radius: _radius |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
Column { |
||||
id: regCol |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
QGCLabel { |
||||
text: qsTr("Airspace Regulations") |
||||
color: _colorWhite |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
} |
||||
QGCLabel { |
||||
text: qsTr("Airspace advisories based on the selected rules.") |
||||
color: _colorWhite |
||||
anchors.left: parent.left |
||||
anchors.right: parent.right |
||||
wrapMode: Text.WordWrap |
||||
font.pointSize: ScreenTools.smallFontPointSize |
||||
} |
||||
GridLayout { |
||||
columns: 2 |
||||
anchors.left: parent.left |
||||
anchors.right: parent.right |
||||
Rectangle { |
||||
width: regButton.height |
||||
height: width |
||||
radius: 2 |
||||
color: _colorGray |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
QGCColoredImage { |
||||
width: height |
||||
height: parent.height * 0.5 |
||||
sourceSize.height: height |
||||
source: "qrc:/airmap/pencil.svg" |
||||
color: _colorWhite |
||||
anchors.centerIn: parent |
||||
} |
||||
} |
||||
Rectangle { |
||||
id: regButton |
||||
height: regLabel.height + ScreenTools.defaultFontPixelHeight * 0.5 |
||||
radius: 2 |
||||
color: _colorMidBrown |
||||
Layout.fillWidth: true |
||||
QGCLabel { |
||||
id: regLabel |
||||
text: qsTr("FAA-107, Airmap") |
||||
color: _colorWhite |
||||
anchors.centerIn: parent |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
AirspaceRegulation { |
||||
regTitle: qsTr("Controlled Aispace (1)") |
||||
regText: qsTr("Santa Monica Class D requires FAA Authorization, permissible below 100ft.") |
||||
regColor: _colorOrange |
||||
textColor: _colorWhite |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
} |
||||
AirspaceRegulation { |
||||
regTitle: qsTr("Schools (2)") |
||||
regText: qsTr("Santa Monica School of Something.") |
||||
regColor: _colorYellow |
||||
textColor: _colorWhite |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
} |
||||
} |
||||
} |
||||
//-- Footer |
||||
QGCLabel { |
||||
text: qsTr("Powered by <b>AIRMAP</b>") |
||||
color: _colorWhite |
||||
font.pointSize: ScreenTools.smallFontPointSize |
||||
anchors.horizontalCenter: parent.horizontalCenter |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 1.2 |
||||
import QtQuick.Controls.Styles 1.4 |
||||
import QtQuick.Dialogs 1.2 |
||||
import QtQml 2.2 |
||||
|
||||
import QGroundControl 1.0 |
||||
import QGroundControl.ScreenTools 1.0 |
||||
import QGroundControl.Controls 1.0 |
||||
import QGroundControl.Palette 1.0 |
||||
import QGroundControl.Airmap 1.0 |
||||
|
||||
Item { |
||||
id: _root |
||||
height: regCol.height |
||||
|
||||
property var textColor: "white" |
||||
property var regColor: "white" |
||||
property var regTitle: "" |
||||
property var regText: "" |
||||
|
||||
Column { |
||||
id: regCol |
||||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
Row { |
||||
spacing: ScreenTools.defaultFontPixelWidth |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
Rectangle { |
||||
width: height |
||||
height: ScreenTools.defaultFontPixelWidth * 1.5 |
||||
radius: height * 0.5 |
||||
color: regColor |
||||
anchors.verticalCenter: parent.verticalCenter |
||||
} |
||||
QGCLabel { |
||||
text: regTitle |
||||
color: textColor |
||||
} |
||||
} |
||||
QGCLabel { |
||||
text: regText |
||||
color: textColor |
||||
anchors.left: parent.left |
||||
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
anchors.right: parent.right |
||||
anchors.rightMargin: ScreenTools.defaultFontPixelWidth * 0.5 |
||||
wrapMode: Text.WordWrap |
||||
font.pointSize: ScreenTools.smallFontPointSize |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
Module QGroundControl.Airmap |
||||
|
||||
AirspaceControl 1.0 AirspaceControl.qml |
||||
AirspaceRegulation 1.0 AirspaceRegulation.qml |
Loading…
Reference in new issue