Commit d2cc64cc authored by Patrick José Pereira's avatar Patrick José Pereira

MissionItemStatus: Make waypointValuesDisplay with variable width

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent b93d3944
......@@ -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
......
......@@ -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
......
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