diff --git a/src/MissionManager/QGCMapPolygonVisuals.qml b/src/MissionManager/QGCMapPolygonVisuals.qml index 7c51c0473585a5785199e53010cb37f05feab54f..c00fb1b95991c12da619b99d97a5a161e502f94e 100644 --- a/src/MissionManager/QGCMapPolygonVisuals.qml +++ b/src/MissionManager/QGCMapPolygonVisuals.qml @@ -516,10 +516,11 @@ Item { id: toolbarComponent PlanEditToolbar { - x: mapControl.centerViewport.left - y: mapControl.centerViewport.top - width: mapControl.centerViewport.width - z: QGroundControl.zOrderMapItems + 2 + anchors.horizontalCenter: mapControl.left + anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2) + y: mapControl.centerViewport.top + z: QGroundControl.zOrderMapItems + 2 + availableWidth: mapControl.centerViewport.width QGCButton { _horizontalPadding: 0 diff --git a/src/MissionManager/QGCMapPolylineVisuals.qml b/src/MissionManager/QGCMapPolylineVisuals.qml index fbd9a816a617e97cac2772a965671e8993fd697f..ab88a61c9a24a8869348c95978fa9cc472ac556a 100644 --- a/src/MissionManager/QGCMapPolylineVisuals.qml +++ b/src/MissionManager/QGCMapPolylineVisuals.qml @@ -314,10 +314,11 @@ Item { id: toolbarComponent PlanEditToolbar { - x: mapControl.centerViewport.left - y: mapControl.centerViewport.top - width: mapControl.centerViewport.width - z: QGroundControl.zOrderMapItems + 2 + anchors.horizontalCenter: mapControl.left + anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2) + y: mapControl.centerViewport.top + z: QGroundControl.zOrderMapItems + 2 + availableWidth: mapControl.centerViewport.width QGCButton { _horizontalPadding: 0 diff --git a/src/PlanView/PlanEditToolbar.qml b/src/PlanView/PlanEditToolbar.qml index 7822e41a583435b81cafcecc7a1a110b448592f4..9601945662eae0de2922718e5508586cab955631 100644 --- a/src/PlanView/PlanEditToolbar.qml +++ b/src/PlanView/PlanEditToolbar.qml @@ -14,14 +14,18 @@ import QtQuick.Layouts 1.2 import QGroundControl 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 /// Toolbar used for things like Polygon editing tools Item { + width: Math.min(toolsRowLayout.width + (_margins * 2), availableWidth) height: toolsFlickable.y + toolsFlickable.height + _margins z: QGroundControl.zOrderMapItems + 2 - property real _radius: ScreenTools.defaultFontPixelWidth / 2 - property real _margins: ScreenTools.defaultFontPixelWidth / 2 + property real availableWidth + + property real _radius: ScreenTools.defaultFontPixelWidth / 2 + property real _margins: ScreenTools.defaultFontPixelWidth / 2 Component.onCompleted: { // Move the child controls from consumer into the layout control @@ -39,8 +43,7 @@ Item { Rectangle { anchors.fill: parent radius: _radius - color: "white" - opacity: 0.75 + color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark } QGCFlickable { @@ -64,10 +67,8 @@ Item { id: instructionComponent QGCLabel { - id: instructionLabel - color: "black" - text: _instructionText - Layout.fillWidth: true + id: instructionLabel + text: _instructionText } } }