diff --git a/src/PlanView/MissionItemStatus.qml b/src/PlanView/MissionItemStatus.qml index 1d74f3d..9443566 100644 --- a/src/PlanView/MissionItemStatus.qml +++ b/src/PlanView/MissionItemStatus.qml @@ -19,6 +19,7 @@ import QGroundControl.FactSystem 1.0 import QGroundControl.FactControls 1.0 Rectangle { + id: root height: ScreenTools.defaultFontPixelHeight * 7 radius: ScreenTools.defaultFontPixelWidth * 0.5 color: qgcPal.window @@ -27,8 +28,14 @@ Rectangle { property var missionItems ///< List of all available mission items + property real maxWidth: parent.width readonly property real _margins: ScreenTools.defaultFontPixelWidth + onMaxWidthChanged: { + var calcLength = (statusListView.count + 1)*statusListView.contentItem.children[0].width + root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth + } + QGCPalette { id: qgcPal } QGCLabel { @@ -56,6 +63,11 @@ Rectangle { clip: true currentIndex: _currentMissionIndex + onCountChanged: { + var calcLength = (statusListView.count + 1)*statusListView.contentItem.children[0].width + root.width = root.maxWidth > calcLength ? calcLength : root.maxWidth + } + delegate: Item { height: statusListView.height width: display ? (indicator.width + spacing) : 0 diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 30618bf..694cb30 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -640,7 +640,7 @@ QGCView { id: waypointValuesDisplay anchors.margins: ScreenTools.defaultFontPixelWidth anchors.left: parent.left - anchors.right: rightPanel.left + maxWidth: parent.width - rightPanel.width - x anchors.bottom: parent.bottom missionItems: _missionController.visualItems visible: _editingLayer === _layerMission && !ScreenTools.isShortScreen