Commit 4a39f75a authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3734 from DonLakeFlyer/SmallFixes

Center hdop in toolbar, fix goto enabled state handling
parents d276f239 4210e759
...@@ -126,11 +126,13 @@ FlightMap { ...@@ -126,11 +126,13 @@ FlightMap {
onClicked: { onClicked: {
if (_activeVehicle) { if (_activeVehicle) {
if (_activeVehicle.guidedMode && flightWidgets.guidedModeBar.state == "Shown") { if (flightWidgets.guidedModeBar.state != "Shown") {
flightWidgets.guidedModeBar.state = "Shown"
} else {
if (flightWidgets.gotoEnabled) {
_gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y)) _gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y))
flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo) flightWidgets.guidedModeBar.confirmAction(flightWidgets.guidedModeBar.confirmGoTo)
} else { }
flightWidgets.guidedModeBar.state = "Shown"
} }
} }
} }
......
...@@ -26,6 +26,7 @@ Item { ...@@ -26,6 +26,7 @@ Item {
id: _root id: _root
property alias guidedModeBar: _guidedModeBar property alias guidedModeBar: _guidedModeBar
property bool gotoEnabled: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
...@@ -444,7 +445,7 @@ Item { ...@@ -444,7 +445,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight color: _lightWidgetBorders ? qgcPal.mapWidgetBorderDark : qgcPal.mapWidgetBorderLight
text: "Click in map to move vehicle" text: "Click in map to move vehicle"
visible: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying visible: gotoEnabled
} }
Row { Row {
......
...@@ -139,12 +139,14 @@ Row { ...@@ -139,12 +139,14 @@ Row {
anchors.left: gpsIcon.right anchors.left: gpsIcon.right
QGCLabel { QGCLabel {
anchors.horizontalCenter: hdopValue.horizontalCenter
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.count.valueString : "" text: activeVehicle ? activeVehicle.gps.count.valueString : ""
} }
QGCLabel { QGCLabel {
id: hdopValue
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value) visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
color: qgcPal.buttonText color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : "" text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : ""
......
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