diff --git a/src/AutoPilotPlugins/Common/SetupPage.qml b/src/AutoPilotPlugins/Common/SetupPage.qml index 647eff5069dd2d321dceac06183cd0e28cb444d0..a2912e368a4de630873568b4028d8779386e2427 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") - } - } - }