Commit 05852c3b authored by Nate Weibley's avatar Nate Weibley

Tweaks to mission editor model views. Helps to address #3456

parent c29de21a
...@@ -285,7 +285,6 @@ QGCView { ...@@ -285,7 +285,6 @@ QGCView {
if (addMissionItemsButton.checked) { if (addMissionItemsButton.checked) {
var sequenceNumber = controller.insertSimpleMissionItem(coordinate, controller.visualItems.count) var sequenceNumber = controller.insertSimpleMissionItem(coordinate, controller.visualItems.count)
setCurrentItem(sequenceNumber) setCurrentItem(sequenceNumber)
editorListView.positionViewAtIndex(editorListView.count - 1, ListView.Contain)
} else { } else {
editorMap.mapClicked(coordinate) editorMap.mapClicked(coordinate)
} }
...@@ -485,6 +484,8 @@ QGCView { ...@@ -485,6 +484,8 @@ QGCView {
model: controller.visualItems model: controller.visualItems
cacheBuffer: height * 2 cacheBuffer: height * 2
clip: true clip: true
highlightMoveDuration: 250
delegate: MissionItemEditor { delegate: MissionItemEditor {
missionItem: object missionItem: object
...@@ -499,11 +500,6 @@ QGCView { ...@@ -499,11 +500,6 @@ QGCView {
controller.removeMissionItem(index) controller.removeMissionItem(index)
} }
onInsert: {
var sequenceNumber = controller.insertSimpleMissionItem(editorMap.center, i)
setCurrentItem(sequenceNumber)
}
onMoveHomeToMapCenter: controller.visualItems.get(0).coordinate = editorMap.center onMoveHomeToMapCenter: controller.visualItems.get(0).coordinate = editorMap.center
Connections { Connections {
...@@ -511,7 +507,7 @@ QGCView { ...@@ -511,7 +507,7 @@ QGCView {
onIsCurrentItemChanged: { onIsCurrentItemChanged: {
if (object.isCurrentItem) { if (object.isCurrentItem) {
editorListView.positionViewAtIndex(index, ListView.Contain) editorListView.currentIndex = index
} }
} }
} }
......
...@@ -74,28 +74,21 @@ Rectangle { ...@@ -74,28 +74,21 @@ Rectangle {
QGCLabel { text: _azimuthText } QGCLabel { text: _azimuthText }
} }
QGCFlickable { ListView {
id: statusListView
model: missionItems
highlightMoveDuration: 250
anchors.leftMargin: _margins anchors.leftMargin: _margins
anchors.rightMargin: _margins anchors.rightMargin: _margins
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width - valueGrid.width - (_margins * 2) orientation: ListView.Horizontal
contentWidth: graphRow.width spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
visible: _expanded visible: _expanded
width: parent.width - valueGrid.width - (_margins * 2)
clip: true clip: true
delegate: Item {
Row { height: statusListView.height
id: graphRow
anchors.top: parent.top
anchors.bottom: parent.bottom
//anchors.margins: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
spacing: ScreenTools.defaultFontPixelWidth * ScreenTools.smallFontPointRatio
Repeater {
model: missionItems
Item {
height: graphRow.height
width: indicator.width width: indicator.width
visible: object.specifiesCoordinate && !object.isStandaloneCoordinate visible: object.specifiesCoordinate && !object.isStandaloneCoordinate
...@@ -111,16 +104,13 @@ Rectangle { ...@@ -111,16 +104,13 @@ Rectangle {
label: object.abbreviation label: object.abbreviation
visible: object.relativeAltitude ? true : (object.homePosition || graphAbsolute) visible: object.relativeAltitude ? true : (object.homePosition || graphAbsolute)
} }
Connections {
target: object
/* onIsCurrentItemChanged: {
Taking these off for now since there really isn't room for the numbers if (object.isCurrentItem) {
QGCLabel { statusListView.currentIndex = index
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: ScreenTools.smallFontPointSize
text: (object.relativeAltitude ? "" : "=") + object.coordinate.altitude.toFixed(0)
} }
*/
} }
} }
} }
......
...@@ -13,7 +13,7 @@ import QGroundControl.Palette 1.0 ...@@ -13,7 +13,7 @@ import QGroundControl.Palette 1.0
Rectangle { Rectangle {
id: valuesRect id: valuesRect
width: availableWidth width: availableWidth
height: valuesItem.height height: visible ? valuesItem.height : 0
color: qgcPal.windowShadeDark color: qgcPal.windowShadeDark
visible: missionItem.isCurrentItem visible: missionItem.isCurrentItem
radius: _radius radius: _radius
......
...@@ -10,7 +10,7 @@ import QGroundControl.Palette 1.0 ...@@ -10,7 +10,7 @@ import QGroundControl.Palette 1.0
// Editor for Survery mission items // Editor for Survery mission items
Rectangle { Rectangle {
id: _root id: _root
height: editorColumn.height + (_margin * 2) height: visible ? (editorColumn.height + (_margin * 2)) : 0
width: availableWidth width: availableWidth
color: qgcPal.windowShadeDark color: qgcPal.windowShadeDark
radius: _radius radius: _radius
......
...@@ -151,9 +151,9 @@ Rectangle { ...@@ -151,9 +151,9 @@ Rectangle {
anchors.topMargin: _margin anchors.topMargin: _margin
anchors.left: parent.left anchors.left: parent.left
anchors.top: commandPicker.bottom anchors.top: commandPicker.bottom
height: _currentItem && item ? item.height : 0 height: item ? item.height : 0
source: _currentItem ? (missionItem.isSimpleItem ? "qrc:/qml/SimpleItemEditor.qml" : "qrc:/qml/SurveyItemEditor.qml") : "" source: missionItem.isSimpleItem ? "qrc:/qml/SimpleItemEditor.qml" : "qrc:/qml/SurveyItemEditor.qml"
onLoaded: { item.visible = Qt.binding(function() { return _currentItem; }) }
property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be
property var editorRoot: _root property var editorRoot: _root
} }
......
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