Commit 9226dcae authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4933 from DonLakeFlyer/ToolStripFixes

Tool strip fixes
parents fe8e61e5 844e6780
...@@ -170,6 +170,7 @@ QString PX4FirmwarePlugin::flightMode(uint8_t base_mode, uint32_t custom_mode) c ...@@ -170,6 +170,7 @@ QString PX4FirmwarePlugin::flightMode(uint8_t base_mode, uint32_t custom_mode) c
if (!found) { if (!found) {
qWarning() << "Unknown flight mode" << custom_mode; qWarning() << "Unknown flight mode" << custom_mode;
return tr("Unknown %1:%2").arg(base_mode).arg(custom_mode);
} }
} else { } else {
qWarning() << "PX4 Flight Stack flight mode without custom mode enabled?"; qWarning() << "PX4 Flight Stack flight mode without custom mode enabled?";
......
...@@ -348,7 +348,7 @@ QGCView { ...@@ -348,7 +348,7 @@ QGCView {
z: _panel.z + 4 z: _panel.z + 4
title: qsTr("Fly") title: qsTr("Fly")
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y
buttonVisible: [ guidedController.showTakeoff || !guidedController.showLand, guidedController.showLand, true, true, true, guidedController.smartShotsAvailable ] buttonVisible: [ guidedController.showTakeoff || !guidedController.showLand, guidedController.showLand && !guidedController.showTakeoff, true, true, true, guidedController.smartShotsAvailable ]
buttonEnabled: [ guidedController.showTakeoff, guidedController.showLand, guidedController.showRTL, guidedController.showPause, _anyActionAvailable, _anySmartShotAvailable ] buttonEnabled: [ guidedController.showTakeoff, guidedController.showLand, guidedController.showRTL, guidedController.showPause, _anyActionAvailable, _anySmartShotAvailable ]
property bool _anyActionAvailable: guidedController.showEmergenyStop || guidedController.showStartMission || guidedController.showResumeMission || guidedController.showChangeAlt || guidedController.showLandAbort property bool _anyActionAvailable: guidedController.showEmergenyStop || guidedController.showStartMission || guidedController.showResumeMission || guidedController.showChangeAlt || guidedController.showLandAbort
......
...@@ -39,7 +39,7 @@ Rectangle { ...@@ -39,7 +39,7 @@ Rectangle {
// whether to show or hide the optional elements on the fly. // whether to show or hide the optional elements on the fly.
property bool _showOptionalElements: true property bool _showOptionalElements: true
property bool _needRecalc: true property bool _needRecalc: false
Component.onCompleted: recalcShowOptionalElements() Component.onCompleted: recalcShowOptionalElements()
...@@ -54,7 +54,6 @@ Rectangle { ...@@ -54,7 +54,6 @@ Rectangle {
onDefaultFontPixelHeightChanged: recalcShowOptionalElements() onDefaultFontPixelHeightChanged: recalcShowOptionalElements()
} }
/*
onHeightChanged: { onHeightChanged: {
if (_needRecalc) { if (_needRecalc) {
_needRecalc = false _needRecalc = false
...@@ -63,18 +62,13 @@ Rectangle { ...@@ -63,18 +62,13 @@ Rectangle {
} }
} }
} }
*/
function recalcShowOptionalElements() { function recalcShowOptionalElements() {
if (_showOptionalElements) { if (maxHeight > 0) {
if (maxHeight && height > maxHeight) { _needRecalc = false
_showOptionalElements = false _showOptionalElements = height <= maxHeight
}
} else {
_needRecalc = true _needRecalc = true
_showOptionalElements = true
} }
} }
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment