From 894370efee71c4a7035034b113aa39c81aa115ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sat, 21 Nov 2020 17:58:28 -0300 Subject: [PATCH] Fix map scale behaviour (#9178) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FlyViewWidgetLayer: Fix check for fullState condition Signed-off-by: Patrick José Pereira * FlyViewMap: Add MapScale when map is in windowState Signed-off-by: Patrick José Pereira --- src/FlightDisplay/FlyViewMap.qml | 13 +++++++++++++ src/FlightDisplay/FlyViewWidgetLayer.qml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/FlightDisplay/FlyViewMap.qml b/src/FlightDisplay/FlyViewMap.qml index ac66245..acff58b 100644 --- a/src/FlightDisplay/FlyViewMap.qml +++ b/src/FlightDisplay/FlyViewMap.qml @@ -49,6 +49,7 @@ FlightMap { property var _rallyPointController: planMasterController.rallyPointController property var _activeVehicleCoordinate: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate() property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2) + property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75 property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false property var _flyViewSettings: QGroundControl.settingsManager.flyViewSettings property bool _keepMapCenteredOnVehicle: _flyViewSettings.keepMapCenteredOnVehicle.rawValue @@ -572,4 +573,16 @@ FlightMap { } } + MapScale { + id: mapScale + anchors.margins: _toolsMargin + anchors.left: parent.left + anchors.top: parent.top + mapControl: _root + buttonsOnLeft: false + visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state === mapControl.pipState.windowState + + property real centerInset: visible ? parent.height - y : 0 + } + } diff --git a/src/FlightDisplay/FlyViewWidgetLayer.qml b/src/FlightDisplay/FlyViewWidgetLayer.qml index 0125319..b8b80dc 100644 --- a/src/FlightDisplay/FlyViewWidgetLayer.qml +++ b/src/FlightDisplay/FlyViewWidgetLayer.qml @@ -203,7 +203,7 @@ Item { anchors.top: parent.top mapControl: _mapControl buttonsOnLeft: false - visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state !== mapControl.pipState.pipState + visible: !ScreenTools.isTinyScreen && QGroundControl.corePlugin.options.flyView.showMapScale && mapControl.pipState.state === mapControl.pipState.fullState property real centerInset: visible ? parent.height - y : 0 }