Commit 18cf8ba9 authored by dogmaphobic's avatar dogmaphobic

Fixing the Mission Editor view to respect the view area (so the map extends beneath the toolbar)

parent 28373366
...@@ -90,7 +90,7 @@ QGCView { ...@@ -90,7 +90,7 @@ QGCView {
function loadFromFile() { function loadFromFile() {
if (ScreenTools.isMobile) { if (ScreenTools.isMobile) {
_root.showDialog(mobileFilePicker, qsTr("Select Mission File"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) _root.showDialog(mobileFilePicker, qsTr("Select Mission File"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel, true)
} else { } else {
controller.loadMissionFromFilePicker() controller.loadMissionFromFilePicker()
fitViewportToMissionItems() fitViewportToMissionItems()
...@@ -99,7 +99,7 @@ QGCView { ...@@ -99,7 +99,7 @@ QGCView {
function saveToFile() { function saveToFile() {
if (ScreenTools.isMobile) { if (ScreenTools.isMobile) {
_root.showDialog(mobileFileSaver, qsTr("Save Mission File"), _root.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) _root.showDialog(mobileFileSaver, qsTr("Save Mission File"), _root.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel, true)
} else { } else {
controller.saveMissionToFilePicker() controller.saveMissionToFilePicker()
} }
...@@ -252,14 +252,20 @@ QGCView { ...@@ -252,14 +252,20 @@ QGCView {
QGCViewPanel { QGCViewPanel {
id: panel id: panel
anchors.fill: parent height: ScreenTools.availableHeight
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Item { Item {
anchors.fill: parent anchors.fill: parent
FlightMap { FlightMap {
id: editorMap id: editorMap
anchors.fill: parent height: _root.height
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
mapName: "MissionEditor" mapName: "MissionEditor"
signal mapClicked(var coordinate) signal mapClicked(var coordinate)
...@@ -277,9 +283,13 @@ QGCView { ...@@ -277,9 +283,13 @@ QGCView {
} }
MouseArea { MouseArea {
//-- It's a whole lot faster to just fill parent and deal with top offset below
// than computing the coordinate offset.
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
//-- Don't pay attention to items beneath the toolbar.
var topLimit = parent.height - ScreenTools.availableHeight
if(mouse.y >= topLimit) {
var coordinate = editorMap.toCoordinate(Qt.point(mouse.x, mouse.y)) var coordinate = editorMap.toCoordinate(Qt.point(mouse.x, mouse.y))
coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces) coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces) coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
...@@ -293,6 +303,7 @@ QGCView { ...@@ -293,6 +303,7 @@ QGCView {
} }
} }
} }
}
// We use this item to support dragging since dragging a MapQuickItem just doesn't seem to work // We use this item to support dragging since dragging a MapQuickItem just doesn't seem to work
Rectangle { Rectangle {
...@@ -399,6 +410,9 @@ QGCView { ...@@ -399,6 +410,9 @@ QGCView {
missionItem: object missionItem: object
sequenceNumber: object.sequenceNumber sequenceNumber: object.sequenceNumber
//-- If you don't want to allow selecting items beneath the
// toolbar, the code below has to check and see if mouse.y
// is greater than (map.height - ScreenTools.availableHeight)
onClicked: setCurrentItem(object.sequenceNumber) onClicked: setCurrentItem(object.sequenceNumber)
function updateItemIndicator() { function updateItemIndicator() {
...@@ -458,7 +472,7 @@ QGCView { ...@@ -458,7 +472,7 @@ QGCView {
// Mission Item Editor // Mission Item Editor
Item { Item {
id: missionItemEditor id: missionItemEditor
anchors.top: parent.top height: ScreenTools.availableHeight
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
width: _rightPanelWidth width: _rightPanelWidth
...@@ -530,6 +544,7 @@ QGCView { ...@@ -530,6 +544,7 @@ QGCView {
//-- Vertical Tool Buttons //-- Vertical Tool Buttons
Column { Column {
id: toolColumn id: toolColumn
anchors.topMargin: parent.height - ScreenTools.availableHeight + ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
...@@ -786,7 +801,7 @@ QGCView { ...@@ -786,7 +801,7 @@ QGCView {
onClicked: { onClicked: {
syncButton.hideDropDown() syncButton.hideDropDown()
if (syncNeeded) { if (syncNeeded) {
_root.showDialog(syncLoadFromVehicleOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) _root.showDialog(syncLoadFromVehicleOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel, true)
} else { } else {
loadFromVehicle() loadFromVehicle()
} }
...@@ -814,7 +829,7 @@ QGCView { ...@@ -814,7 +829,7 @@ QGCView {
onClicked: { onClicked: {
syncButton.hideDropDown() syncButton.hideDropDown()
if (syncNeeded) { if (syncNeeded) {
_root.showDialog(syncLoadFromFileOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) _root.showDialog(syncLoadFromFileOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel, true)
} else { } else {
loadFromFile() loadFromFile()
} }
...@@ -826,7 +841,7 @@ QGCView { ...@@ -826,7 +841,7 @@ QGCView {
text: qsTr("Remove all") text: qsTr("Remove all")
onClicked: { onClicked: {
syncButton.hideDropDown() syncButton.hideDropDown()
_root.showDialog(removeAllPromptDialog, qsTr("Delete all"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) _root.showDialog(removeAllPromptDialog, qsTr("Delete all"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No, true)
} }
} }
......
...@@ -296,10 +296,7 @@ Item { ...@@ -296,10 +296,7 @@ Item {
Loader { Loader {
id: planViewLoader id: planViewLoader
anchors.left: parent.left anchors.fill: parent
anchors.right: parent.right
anchors.top: toolBar.bottom
anchors.bottom: parent.bottom
visible: false visible: false
} }
......
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