From 4132f7706bf720976eb2ab5347ead43e5f307d37 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 28 Sep 2018 08:27:32 -0700 Subject: [PATCH] Add box around map warnings text --- .../FlightDisplayViewWidgets.qml | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 299962670..b3b346393 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -104,37 +104,51 @@ Item { } //-- Map warnings + + Rectangle { + anchors.margins: -ScreenTools.defaultFontPixelHeight + anchors.fill: warningsCol + color: "white" + opacity: 0.5 + radius: ScreenTools.defaultFontPixelWidth / 2 + visible: warningsCol.noGPSLockVisible || warningsCol.prearmErrorVisible + } + Column { + id: warningsCol anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.verticalCenter spacing: ScreenTools.defaultFontPixelHeight + property bool noGPSLockVisible: _activeVehicle && !_activeVehicle.coordinate.isValid && _mainIsMap + property bool prearmErrorVisible: _activeVehicle && _activeVehicle.prearmError + QGCLabel { anchors.horizontalCenter: parent.horizontalCenter - visible: _activeVehicle && !_activeVehicle.coordinate.isValid && _mainIsMap + visible: warningsCol.noGPSLockVisible z: QGroundControl.zOrderTopMost - color: mapPal.text + color: "black" font.pointSize: ScreenTools.largeFontPointSize text: qsTr("No GPS Lock for Vehicle") } QGCLabel { anchors.horizontalCenter: parent.horizontalCenter - visible: _activeVehicle && _activeVehicle.prearmError + visible: warningsCol.prearmErrorVisible z: QGroundControl.zOrderTopMost - color: mapPal.text + color: "black" font.pointSize: ScreenTools.largeFontPointSize text: _activeVehicle ? _activeVehicle.prearmError : "" } QGCLabel { anchors.horizontalCenter: parent.horizontalCenter - visible: _activeVehicle && _activeVehicle.prearmError + visible: warningsCol.prearmErrorVisible width: ScreenTools.defaultFontPixelWidth * 50 horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap z: QGroundControl.zOrderTopMost - color: mapPal.text + color: "black" font.pointSize: ScreenTools.largeFontPointSize text: "The vehicle has failed a pre-arm check. In order to arm the vehicle, resolve the failure." } -- 2.22.0