Browse Source

Remove boost (must create a symlink for now)

Adjust Airspace control text color to match changing background color
QGC4.4
Gus Grubba 7 years ago
parent
commit
04307f7b0f
  1. 1
      .gitignore
  2. 55
      src/Airmap/AirspaceControl.qml
  3. 6
      src/Airmap/AirspaceWeather.qml

1
.gitignore vendored

@ -84,3 +84,4 @@ src/latex/
.vagrant/ .vagrant/
Qt*-linux*.tar.* Qt*-linux*.tar.*
libs/airmapd/include/boost

55
src/Airmap/AirspaceControl.qml

@ -23,8 +23,10 @@ Item {
property bool showColapse: true property bool showColapse: true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool validRules: _activeVehicle ? _activeVehicle.airspaceController.rulesets.valid : false property color _airspaceColor: _validAdvisories ? getAispaceColor(_activeVehicle.airspaceController.advisories.airspaceColor) : _colorGray
property bool validAdvisories: _activeVehicle ? _activeVehicle.airspaceController.advisories.valid : false property bool _validRules: _activeVehicle ? _activeVehicle.airspaceController.rulesets.valid : false
property bool _validAdvisories: _activeVehicle ? _activeVehicle.airspaceController.advisories.valid : false
property color _textColor: qgcPal.text
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property color _colorOrange: "#d75e0d" readonly property color _colorOrange: "#d75e0d"
@ -50,13 +52,23 @@ Item {
return _colorGray; return _colorGray;
} }
on_AirspaceColorChanged: {
if(_validAdvisories) {
if(_activeVehicle.airspaceController.advisories.airspaceColor === AirspaceAdvisoryProvider.Yellow) {
_textColor = "#000000"
return
}
}
_textColor = _colorWhite
}
//--------------------------------------------------------------- //---------------------------------------------------------------
//-- Colapsed State //-- Colapsed State
Rectangle { Rectangle {
id: colapsedRect id: colapsedRect
width: parent.width width: parent.width
height: colapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0 height: colapsed ? colapsedRow.height + ScreenTools.defaultFontPixelHeight : 0
color: validAdvisories ? getAispaceColor(_activeVehicle.airspaceController.advisories.airspaceColor) : _colorGray color: _validAdvisories ? getAispaceColor(_activeVehicle.airspaceController.advisories.airspaceColor) : _colorGray
radius: _radius radius: _radius
visible: colapsed visible: colapsed
Row { Row {
@ -70,12 +82,12 @@ Item {
height: ScreenTools.defaultFontPixelWidth * 2.5 height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height sourceSize.height: height
source: "qrc:/airmap/advisory-icon.svg" source: "qrc:/airmap/advisory-icon.svg"
color: _colorWhite color: _textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel { QGCLabel {
text: qsTr("Airspace") text: qsTr("Airspace")
color: _colorWhite color: _textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Item { Item {
@ -85,6 +97,7 @@ Item {
AirspaceWeather { AirspaceWeather {
iconHeight: ScreenTools.defaultFontPixelWidth * 2.5 iconHeight: ScreenTools.defaultFontPixelWidth * 2.5
visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid
contentColor: _textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
@ -93,7 +106,7 @@ Item {
height: ScreenTools.defaultFontPixelWidth * 2.5 height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height sourceSize.height: height
source: "qrc:/airmap/expand.svg" source: "qrc:/airmap/expand.svg"
color: _colorWhite color: _textColor
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -109,7 +122,7 @@ Item {
id: expandedRect id: expandedRect
width: parent.width width: parent.width
height: !colapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0 height: !colapsed ? expandedCol.height + ScreenTools.defaultFontPixelHeight : 0
color: validAdvisories ? getAispaceColor(_activeVehicle.airspaceController.advisories.airspaceColor) : _colorGray color: _validAdvisories ? getAispaceColor(_activeVehicle.airspaceController.advisories.airspaceColor) : _colorGray
radius: _radius radius: _radius
visible: !colapsed visible: !colapsed
MouseArea { MouseArea {
@ -139,7 +152,7 @@ Item {
height: ScreenTools.defaultFontPixelWidth * 2.5 height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height sourceSize.height: height
source: "qrc:/airmap/advisory-icon.svg" source: "qrc:/airmap/advisory-icon.svg"
color: _colorWhite color: _textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Column { Column {
@ -147,12 +160,12 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
QGCLabel { QGCLabel {
text: qsTr("Airspace") text: qsTr("Airspace")
color: _colorWhite color: _textColor
} }
QGCLabel { QGCLabel {
text: validAdvisories ? _activeVehicle.airspaceController.advisories.airspaces.count + qsTr(" Advisories") : "" text: _validAdvisories ? _activeVehicle.airspaceController.advisories.airspaces.count + qsTr(" Advisories") : ""
color: _colorWhite color: _textColor
visible: validAdvisories visible: _validAdvisories
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
} }
} }
@ -162,6 +175,7 @@ Item {
} }
AirspaceWeather { AirspaceWeather {
visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid && showColapse visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid && showColapse
contentColor: _textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
@ -170,7 +184,7 @@ Item {
height: ScreenTools.defaultFontPixelWidth * 2.5 height: ScreenTools.defaultFontPixelWidth * 2.5
sourceSize.height: height sourceSize.height: height
source: "qrc:/airmap/colapse.svg" source: "qrc:/airmap/colapse.svg"
color: _colorWhite color: _textColor
visible: showColapse visible: showColapse
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
@ -183,6 +197,7 @@ Item {
} }
AirspaceWeather { AirspaceWeather {
visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid && !showColapse visible: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid && !showColapse
contentColor: _textColor
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -270,10 +285,10 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
QGCLabel { QGCLabel {
id: regLabel id: regLabel
text: validRules ? _activeVehicle.airspaceController.rulesets.rules.get(currentIndex).name : qsTr("None") text: _validRules ? _activeVehicle.airspaceController.rulesets.rules.get(currentIndex).name : qsTr("None")
color: _colorWhite color: _colorWhite
anchors.centerIn: parent anchors.centerIn: parent
property int currentIndex: validRules ? _activeVehicle.airspaceController.rulesets.currentIndex : 0 property int currentIndex: _validRules ? _activeVehicle.airspaceController.rulesets.currentIndex : 0
} }
} }
} }
@ -294,7 +309,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
Repeater { Repeater {
model: validAdvisories ? _activeVehicle.airspaceController.advisories.airspaces : [] model: _validAdvisories ? _activeVehicle.airspaceController.advisories.airspaces : []
delegate: AirspaceRegulation { delegate: AirspaceRegulation {
regTitle: object.typeStr regTitle: object.typeStr
regText: object.name regText: object.name
@ -312,7 +327,7 @@ Item {
//-- Footer //-- Footer
QGCLabel { QGCLabel {
text: qsTr("Powered by <b>AIRMAP</b>") text: qsTr("Powered by <b>AIRMAP</b>")
color: _colorWhite color: _textColor
font.pointSize: ScreenTools.smallFontPointSize font.pointSize: ScreenTools.smallFontPointSize
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
@ -399,7 +414,7 @@ Item {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
} }
Repeater { Repeater {
model: validRules ? _activeVehicle.airspaceController.rulesets.rules : [] model: _validRules ? _activeVehicle.airspaceController.rulesets.rules : []
delegate: RuleSelector { delegate: RuleSelector {
visible: object.selectionType === AirspaceRule.Pickone visible: object.selectionType === AirspaceRule.Pickone
rule: object rule: object
@ -419,7 +434,7 @@ Item {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
} }
Repeater { Repeater {
model: validRules ? _activeVehicle.airspaceController.rulesets.rules : [] model: _validRules ? _activeVehicle.airspaceController.rulesets.rules : []
delegate: RuleSelector { delegate: RuleSelector {
visible: object.selectionType === AirspaceRule.Optional visible: object.selectionType === AirspaceRule.Optional
rule: object rule: object
@ -439,7 +454,7 @@ Item {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
} }
Repeater { Repeater {
model: validRules ? _activeVehicle.airspaceController.rulesets.rules : [] model: _validRules ? _activeVehicle.airspaceController.rulesets.rules : []
delegate: RuleSelector { delegate: RuleSelector {
visible: object.selectionType === AirspaceRule.Required visible: object.selectionType === AirspaceRule.Required
rule: object rule: object

6
src/Airmap/AirspaceWeather.qml

@ -14,9 +14,9 @@ import QGroundControl.SettingsManager 1.0
Item { Item {
height: _valid ? weatherRow.height : 0 height: _valid ? weatherRow.height : 0
width: _valid ? weatherRow.width : 0 width: _valid ? weatherRow.width : 0
property color contentColor: "#ffffff"
property var iconHeight: ScreenTools.defaultFontPixelWidth * 4 property var iconHeight: ScreenTools.defaultFontPixelWidth * 4
property bool _valid: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid property bool _valid: _activeVehicle && _activeVehicle.airspaceController.weatherInfo.valid
property color _colorWhite: "#ffffff"
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _celcius: QGroundControl.settingsManager.unitsSettings.temperatureUnits.rawValue === UnitsSettings.TemperatureUnitsCelsius property bool _celcius: QGroundControl.settingsManager.unitsSettings.temperatureUnits.rawValue === UnitsSettings.TemperatureUnitsCelsius
property int _tempC: _valid ? _activeVehicle.airspaceController.weatherInfo.temperature : 0 property int _tempC: _valid ? _activeVehicle.airspaceController.weatherInfo.temperature : 0
@ -29,13 +29,13 @@ Item {
height: iconHeight height: iconHeight
sourceSize.height: height sourceSize.height: height
source: _valid ? _activeVehicle.airspaceController.weatherInfo.icon : "" source: _valid ? _activeVehicle.airspaceController.weatherInfo.icon : ""
color: _colorWhite color: contentColor
visible: _valid visible: _valid
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
QGCLabel { QGCLabel {
text: _tempS text: _tempS
color: _colorWhite color: contentColor
visible: _valid visible: _valid
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }

Loading…
Cancel
Save