From 5dcee98126ae7fcb3e9dbf7c64d2d5d193ed2ec9 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Wed, 17 Jan 2018 12:04:39 -0500 Subject: [PATCH] UI Tweak --- src/AutoPilotPlugins/Common/SetupPage.qml | 36 ++++++++++--------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/AutoPilotPlugins/Common/SetupPage.qml b/src/AutoPilotPlugins/Common/SetupPage.qml index 647eff5..a2912e3 100644 --- a/src/AutoPilotPlugins/Common/SetupPage.qml +++ b/src/AutoPilotPlugins/Common/SetupPage.qml @@ -35,6 +35,8 @@ QGCView { property bool _shouldDisableWhenArmed: _vehicleArmed ? (vehicleComponent ? !vehicleComponent.allowSetupWhileArmed : false) : false property real _margins: ScreenTools.defaultFontPixelHeight * 0.5 + property string _pageTitle: qsTr("%1 Setup").arg(pageName) + QGCPalette { id: qgcPal; colorGroupEnabled: setupPanel.enabled } @@ -55,7 +57,7 @@ QGCView { QGCLabel { font.pointSize: ScreenTools.largeFontPointSize - text: qsTr("%1 Setup").arg(pageName) + text: _shouldDisableWhenArmed ? _pageTitle + "" + qsTr(" (Disabled while the vehicle is armed)") + "" : _pageTitle visible: !ScreenTools.isShortScreen } @@ -73,30 +75,14 @@ QGCView { anchors.topMargin: _margins anchors.top: headingColumn.bottom } + // Overlay to display when vehicle is armed and this setup page needs + // to be disabled + Rectangle { + visible: _shouldDisableWhenArmed + anchors.fill: pageLoader + color: "black" + opacity: 0.5 + } } } - - // Overlay to display when vehicle is armed and this setup page needs - // to be disabled - Item { - visible: _shouldDisableWhenArmed - anchors.fill: parent - z: 9999 - Rectangle { - anchors.fill: parent - color: "black" - opacity: 0.5 - } - QGCLabel { - anchors.margins: defaultTextWidth * 2 - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WordWrap - font.pointSize: ScreenTools.largeFontPointSize - color: "red" - text: qsTr("Setup disabled while the vehicle is armed") - } - } - }