Commit b878b8df authored by Gus Grubba's avatar Gus Grubba

Fix Z Order Issues

parent 3eca3cca
...@@ -48,10 +48,6 @@ Item { ...@@ -48,10 +48,6 @@ Item {
// Prevents z order drawing problems. // Prevents z order drawing problems.
property bool hideWidgets: false property bool hideWidgets: false
readonly property alias zOrderTopMost: flightMap.zOrderTopMost
readonly property alias zOrderWidgets: flightMap.zOrderWidgets
readonly property alias zOrderMapItems: flightMap.zOrderMapItems
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
property var _activeVehicle: multiVehicleManager.activeVehicle property var _activeVehicle: multiVehicleManager.activeVehicle
...@@ -144,18 +140,18 @@ Item { ...@@ -144,18 +140,18 @@ Item {
label: "H" label: "H"
coordinate: (_activeVehicle && _activeVehicle.homePositionAvailable) ? _activeVehicle.homePosition : QtPositioning.coordinate(0, 0) coordinate: (_activeVehicle && _activeVehicle.homePositionAvailable) ? _activeVehicle.homePosition : QtPositioning.coordinate(0, 0)
visible: _activeVehicle ? _activeVehicle.homePositionAvailable : false visible: _activeVehicle ? _activeVehicle.homePositionAvailable : false
z: flightMap.zOrderMapItems z: QGroundControl.zOrderMapItems
} }
// Add trajectory points to the map // Add trajectory points to the map
MapItemView { MapItemView {
model: multiVehicleManager.activeVehicle ? multiVehicleManager.activeVehicle.trajectoryPoints : 0 model: multiVehicleManager.activeVehicle ? multiVehicleManager.activeVehicle.trajectoryPoints : 0
delegate: delegate:
MapPolyline { MapPolyline {
line.width: 3 line.width: 3
line.color: "orange" line.color: "orange"
z: flightMap.zOrderMapItems - 1 z: QGroundControl.zOrderMapItems - 1
path: [ path: [
...@@ -168,26 +164,24 @@ Item { ...@@ -168,26 +164,24 @@ Item {
// Add the vehicles to the map // Add the vehicles to the map
MapItemView { MapItemView {
model: multiVehicleManager.vehicles model: multiVehicleManager.vehicles
delegate: delegate:
VehicleMapItem { VehicleMapItem {
vehicle: object vehicle: object
coordinate: object.coordinate coordinate: object.coordinate
isSatellite: flightMap.isSatelliteMap isSatellite: flightMap.isSatelliteMap
z: flightMap.zOrderMapItems z: QGroundControl.zOrderMapItems
} }
} }
// Add the mission items to the map // Add the mission items to the map
MissionItemView { MissionItemView {
model: _missionController.missionItems model: _missionController.missionItems
zOrderMapItems: flightMap.zOrderMapItems
} }
// Add lines between waypoints // Add lines between waypoints
MissionLineView { MissionLineView {
model: _missionController.waypointLines model: _missionController.waypointLines
zOrderMapItems: flightMap.zOrderMapItems
} }
Loader { Loader {
......
...@@ -53,7 +53,7 @@ Item { ...@@ -53,7 +53,7 @@ Item {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
visible: object.satelliteLock < 2 visible: object.satelliteLock < 2
text: "No GPS Lock for Vehicle #" + object.id text: "No GPS Lock for Vehicle #" + object.id
z: flightMap.zOrderMapItems - 2 z: QGroundControl.zOrderMapItems - 2
} }
} }
} }
...@@ -66,7 +66,7 @@ Item { ...@@ -66,7 +66,7 @@ Item {
size: ScreenTools.defaultFontPixelSize * (13.3) size: ScreenTools.defaultFontPixelSize * (13.3)
heading: _heading heading: _heading
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
QGCAttitudeWidget { QGCAttitudeWidget {
...@@ -77,7 +77,7 @@ Item { ...@@ -77,7 +77,7 @@ Item {
rollAngle: _roll rollAngle: _roll
pitchAngle: _pitch pitchAngle: _pitch
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
DropButton { DropButton {
...@@ -89,7 +89,7 @@ Item { ...@@ -89,7 +89,7 @@ Item {
buttonImage: "/qmlimages/MapCenter.svg" buttonImage: "/qmlimages/MapCenter.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
dropDownComponent: Component { dropDownComponent: Component {
Row { Row {
...@@ -134,7 +134,7 @@ Item { ...@@ -134,7 +134,7 @@ Item {
buttonImage: "/qmlimages/MapType.svg" buttonImage: "/qmlimages/MapType.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
dropDownComponent: Component { dropDownComponent: Component {
Row { Row {
......
...@@ -52,7 +52,7 @@ Item { ...@@ -52,7 +52,7 @@ Item {
height: ScreenTools.defaultFontPixelSize * (10) height: ScreenTools.defaultFontPixelSize * (10)
heading: _heading heading: _heading
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
QGCAttitudeHUD { QGCAttitudeHUD {
...@@ -62,7 +62,7 @@ Item { ...@@ -62,7 +62,7 @@ Item {
width: ScreenTools.defaultFontPixelSize * (30) width: ScreenTools.defaultFontPixelSize * (30)
height: ScreenTools.defaultFontPixelSize * (30) height: ScreenTools.defaultFontPixelSize * (30)
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
} }
...@@ -71,7 +71,7 @@ Item { ...@@ -71,7 +71,7 @@ Item {
height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65 height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65
width: ScreenTools.defaultFontPixelSize * (5) width: ScreenTools.defaultFontPixelSize * (5)
altitude: _altitudeWGS84 altitude: _altitudeWGS84
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
visible: !hideWidgets visible: !hideWidgets
} }
...@@ -80,7 +80,7 @@ Item { ...@@ -80,7 +80,7 @@ Item {
width: ScreenTools.defaultFontPixelSize * (5) width: ScreenTools.defaultFontPixelSize * (5)
height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65 height: parent.height * 0.65 > ScreenTools.defaultFontPixelSize * (23.4) ? ScreenTools.defaultFontPixelSize * (23.4) : parent.height * 0.65
speed: _groundSpeed speed: _groundSpeed
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
visible: !hideWidgets visible: !hideWidgets
} }
...@@ -90,7 +90,7 @@ Item { ...@@ -90,7 +90,7 @@ Item {
airspeed: _airSpeed airspeed: _airSpeed
groundspeed: _groundSpeed groundspeed: _groundSpeed
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
visible: !hideWidgets visible: !hideWidgets
} }
...@@ -100,15 +100,15 @@ Item { ...@@ -100,15 +100,15 @@ Item {
altitude: _altitudeWGS84 altitude: _altitudeWGS84
vertZ: _climbRate vertZ: _climbRate
active: multiVehicleManager.activeVehicleAvailable active: multiVehicleManager.activeVehicleAvailable
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
visible: !hideWidgets visible: !hideWidgets
} }
QGCButton { QGCButton {
id: optionsButton id: optionsButton
x: _flightMap.mapWidgets.x x: _flightMap.mapWidgets.x
y: _flightMap.mapWidgets.y - height - (ScreenTools.defaultFontPixelHeight / 2) y: _flightMap.mapWidgets.y - height - (ScreenTools.defaultFontPixelHeight / 2)
z: _flightMap.zOrderWidgets z: QGroundControl.zOrderWidgets
width: _flightMap.mapWidgets.width width: _flightMap.mapWidgets.width
text: "Options" text: "Options"
menu: optionsMenu menu: optionsMenu
......
...@@ -55,10 +55,6 @@ Map { ...@@ -55,10 +55,6 @@ Map {
property real lon: (longitude >= -180 && longitude <= 180) ? longitude : 0 property real lon: (longitude >= -180 && longitude <= 180) ? longitude : 0
property real lat: (latitude >= -90 && latitude <= 90) ? latitude : 0 property real lat: (latitude >= -90 && latitude <= 90) ? latitude : 0
readonly property real zOrderTopMost: 1000 ///< z order for top most items, toolbar, main window sub view
readonly property real zOrderWidgets: 100 ///< z order value to widgets, for example: zoom controls, hud widgetss
readonly property real zOrderMapItems: 50 ///< z order value for map items, for example: mission item indicators
readonly property real maxZoomLevel: 20 readonly property real maxZoomLevel: 20
zoomLevel: 18 zoomLevel: 18
...@@ -101,19 +97,19 @@ Map { ...@@ -101,19 +97,19 @@ Map {
readonly property real _zoomIncrement: 1.0 readonly property real _zoomIncrement: 1.0
property real _buttonWidth: ScreenTools.defaultFontPixelWidth * 5 property real _buttonWidth: ScreenTools.defaultFontPixelWidth * 5
NumberAnimation { NumberAnimation {
id: animateZoom id: animateZoom
property real startZoom property real startZoom
property real endZoom property real endZoom
target: _map target: _map
properties: "zoomLevel" properties: "zoomLevel"
from: startZoom from: startZoom
to: endZoom to: endZoom
duration: 500 duration: 500
easing { easing {
type: Easing.OutExpo type: Easing.OutExpo
} }
...@@ -122,10 +118,10 @@ Map { ...@@ -122,10 +118,10 @@ Map {
QGCButton { QGCButton {
width: parent._buttonWidth width: parent._buttonWidth
z: zOrderWidgets z: QGroundControl.zOrderWidgets
//iconSource: "/qmlimages/ZoomPlus.svg" //iconSource: "/qmlimages/ZoomPlus.svg"
text: "+" text: "+"
onClicked: { onClicked: {
var endZoomLevel = _map.zoomLevel + parent._zoomIncrement var endZoomLevel = _map.zoomLevel + parent._zoomIncrement
if (endZoomLevel > _map.maximumZoomLevel) { if (endZoomLevel > _map.maximumZoomLevel) {
...@@ -136,13 +132,13 @@ Map { ...@@ -136,13 +132,13 @@ Map {
animateZoom.start() animateZoom.start()
} }
} }
QGCButton { QGCButton {
width: parent._buttonWidth width: parent._buttonWidth
z: zOrderWidgets z: QGroundControl.zOrderWidgets
//iconSource: "/qmlimages/ZoomMinus.svg" //iconSource: "/qmlimages/ZoomMinus.svg"
text: "-" text: "-"
onClicked: { onClicked: {
var endZoomLevel = _map.zoomLevel - parent._zoomIncrement var endZoomLevel = _map.zoomLevel - parent._zoomIncrement
if (endZoomLevel < _map.minimumZoomLevel) { if (endZoomLevel < _map.minimumZoomLevel) {
...@@ -159,9 +155,9 @@ Map { ...@@ -159,9 +155,9 @@ Map {
/* /*
The slider and scale display are commented out for now to try to save real estate - DonLakeFlyer The slider and scale display are commented out for now to try to save real estate - DonLakeFlyer
Not sure if I'll bring them back or not. Need room for waypoint list at bottom Not sure if I'll bring them back or not. Need room for waypoint list at bottom
property variant scaleLengths: [5, 10, 25, 50, 100, 150, 250, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000] property variant scaleLengths: [5, 10, 25, 50, 100, 150, 250, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000]
function formatDistance(meters) function formatDistance(meters)
{ {
var dist = Math.round(meters) var dist = Math.round(meters)
...@@ -192,7 +188,7 @@ Map { ...@@ -192,7 +188,7 @@ Map {
onZoomLevelChanged:{ onZoomLevelChanged:{
scaleTimer.restart() scaleTimer.restart()
} }
function calculateScale() { function calculateScale() {
var coord1, coord2, dist, text, f var coord1, coord2, dist, text, f
f = 0 f = 0
......
...@@ -35,7 +35,6 @@ import QGroundControl.Controls 1.0 ...@@ -35,7 +35,6 @@ import QGroundControl.Controls 1.0
MapItemView { MapItemView {
id: _root id: _root
property real zOrderMapItems ///< Z order for indicator
property var itemDragger ///< Set to item drag control if you want to support drag property var itemDragger ///< Set to item drag control if you want to support drag
delegate: MissionItemIndicator { delegate: MissionItemIndicator {
...@@ -43,8 +42,8 @@ MapItemView { ...@@ -43,8 +42,8 @@ MapItemView {
label: object.homePosition ? "H" : object.sequenceNumber label: object.homePosition ? "H" : object.sequenceNumber
isCurrentItem: object.isCurrentItem isCurrentItem: object.isCurrentItem
coordinate: object.coordinate coordinate: object.coordinate
z: zOrderMapItems
visible: object.specifiesCoordinate && (!object.homePosition || object.homePositionValid) visible: object.specifiesCoordinate && (!object.homePosition || object.homePositionValid)
z: QGroundControl.zOrderMapItems
onClicked: setCurrentItem(object.sequenceNumber) onClicked: setCurrentItem(object.sequenceNumber)
......
...@@ -30,12 +30,10 @@ import QGroundControl.Palette 1.0 ...@@ -30,12 +30,10 @@ import QGroundControl.Palette 1.0
/// The MissionLineView control is used to add lines between mission items /// The MissionLineView control is used to add lines between mission items
MapItemView { MapItemView {
property real zOrderMapItems ///< Z order for indicator
delegate: MapPolyline { delegate: MapPolyline {
line.width: 3 line.width: 3
line.color: "#be781c" // Hack, can't get palette to work in here line.color: "#be781c" // Hack, can't get palette to work in here
z: zOrderMapItems - 1 // Under item indicators z: QGroundControl.zOrderMapItems - 1 // Under item indicators
path: [ path: [
{ latitude: object.coordinate1.latitude, longitude: object.coordinate1.longitude }, { latitude: object.coordinate1.latitude, longitude: object.coordinate1.longitude },
......
...@@ -41,7 +41,7 @@ QGCView { ...@@ -41,7 +41,7 @@ QGCView {
viewPanel: panel viewPanel: panel
// zOrder comes from the Loader in MainWindow.qml // zOrder comes from the Loader in MainWindow.qml
z: zOrder z: QGroundControl.zOrderTopMost
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2
...@@ -181,7 +181,7 @@ QGCView { ...@@ -181,7 +181,7 @@ QGCView {
width: ScreenTools.defaultFontPixelHeight * 7 width: ScreenTools.defaultFontPixelHeight * 7
height: ScreenTools.defaultFontPixelHeight * 7 height: ScreenTools.defaultFontPixelHeight * 7
visible: false visible: false
z: editorMap.zOrderMapItems + 1 // Above item icons z: QGroundControl.zOrderMapItems + 1 // Above item icons
property var missionItem property var missionItem
property var missionItemIndicator property var missionItemIndicator
...@@ -225,14 +225,12 @@ QGCView { ...@@ -225,14 +225,12 @@ QGCView {
// Add the mission items to the map // Add the mission items to the map
MissionItemView { MissionItemView {
model: controller.missionItems model: controller.missionItems
zOrderMapItems: editorMap.zOrderMapItems
itemDragger: itemEditor itemDragger: itemEditor
} }
// Add lines between waypoints // Add lines between waypoints
MissionLineView { MissionLineView {
model: controller.waypointLines model: controller.waypointLines
zOrderMapItems: editorMap.zOrderMapItems
} }
// Mission Item Editor // Mission Item Editor
...@@ -244,7 +242,7 @@ QGCView { ...@@ -244,7 +242,7 @@ QGCView {
width: _rightPanelWidth width: _rightPanelWidth
visible: !homePositionManagerButton.checked && _missionItems.count > 1 visible: !homePositionManagerButton.checked && _missionItems.count > 1
opacity: _rightPanelOpacity opacity: _rightPanelOpacity
z: editorMap.zOrderTopMost z: QGroundControl.zOrderTopMost
ListView { ListView {
id: missionItemSummaryList id: missionItemSummaryList
...@@ -293,7 +291,7 @@ QGCView { ...@@ -293,7 +291,7 @@ QGCView {
visible: homePositionManagerButton.checked visible: homePositionManagerButton.checked
color: qgcPal.window color: qgcPal.window
opacity: _rightPanelOpacity opacity: _rightPanelOpacity
z: editorMap.zOrderTopMost z: QGroundControl.zOrderTopMost
Column { Column {
anchors.margins: _margin anchors.margins: _margin
...@@ -568,7 +566,7 @@ QGCView { ...@@ -568,7 +566,7 @@ QGCView {
color: qgcPal.window color: qgcPal.window
opacity: _rightPanelOpacity opacity: _rightPanelOpacity
radius: ScreenTools.defaultFontPixelHeight radius: ScreenTools.defaultFontPixelHeight
z: editorMap.zOrderTopMost z: QGroundControl.zOrderTopMost
readonly property real margins: ScreenTools.defaultFontPixelHeight readonly property real margins: ScreenTools.defaultFontPixelHeight
...@@ -760,7 +758,7 @@ QGCView { ...@@ -760,7 +758,7 @@ QGCView {
y: (parent.height - (_toolButtonCount * height) - ((_toolButtonCount - 1) * _margin)) / 2 y: (parent.height - (_toolButtonCount * height) - ((_toolButtonCount - 1) * _margin)) / 2
buttonImage: "/qmlimages/MapAddMission.svg" buttonImage: "/qmlimages/MapAddMission.svg"
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
onCheckedChanged: { onCheckedChanged: {
if (checked) { if (checked) {
...@@ -786,7 +784,7 @@ QGCView { ...@@ -786,7 +784,7 @@ QGCView {
anchors.top: addMissionItemsButton.bottom anchors.top: addMissionItemsButton.bottom
buttonImage: "/qmlimages/TrashDelete.svg" buttonImage: "/qmlimages/TrashDelete.svg"
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
onClicked: { onClicked: {
itemEditor.clearItem() itemEditor.clearItem()
...@@ -802,7 +800,7 @@ QGCView { ...@@ -802,7 +800,7 @@ QGCView {
anchors.top: deleteMissionItemButton.bottom anchors.top: deleteMissionItemButton.bottom
buttonImage: "/qmlimages/MapHome.svg" buttonImage: "/qmlimages/MapHome.svg"
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
} }
DropButton { DropButton {
...@@ -814,7 +812,7 @@ QGCView { ...@@ -814,7 +812,7 @@ QGCView {
buttonImage: "/qmlimages/MapCenter.svg" buttonImage: "/qmlimages/MapCenter.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
dropDownComponent: Component { dropDownComponent: Component {
Column { Column {
...@@ -858,7 +856,7 @@ QGCView { ...@@ -858,7 +856,7 @@ QGCView {
buttonImage: _syncNeeded ? "/qmlimages/MapSyncChanged.svg" : "/qmlimages/MapSync.svg" buttonImage: _syncNeeded ? "/qmlimages/MapSyncChanged.svg" : "/qmlimages/MapSync.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
dropDownComponent: syncDropDownComponent dropDownComponent: syncDropDownComponent
enabled: !_syncInProgress enabled: !_syncInProgress
} }
...@@ -872,7 +870,7 @@ QGCView { ...@@ -872,7 +870,7 @@ QGCView {
buttonImage: "/qmlimages/MapType.svg" buttonImage: "/qmlimages/MapType.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
dropDownComponent: Component { dropDownComponent: Component {
Column { Column {
...@@ -909,7 +907,7 @@ QGCView { ...@@ -909,7 +907,7 @@ QGCView {
anchors.top: mapTypeButton.bottom anchors.top: mapTypeButton.bottom
buttonImage: "/qmlimages/Help.svg" buttonImage: "/qmlimages/Help.svg"
exclusiveGroup: _dropButtonsExclusiveGroup exclusiveGroup: _dropButtonsExclusiveGroup
z: editorMap.zOrderWidgets z: QGroundControl.zOrderWidgets
checked: _showHelp checked: _showHelp
} }
} // FlightMap } // FlightMap
......
/*===================================================================== /*=====================================================================
QGroundControl Open Source Ground Control Station QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> (c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful, QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/ ======================================================================*/
/// @file /// @file
...@@ -39,15 +39,23 @@ class QGroundControlQmlGlobal : public QObject ...@@ -39,15 +39,23 @@ class QGroundControlQmlGlobal : public QObject
public: public:
QGroundControlQmlGlobal(QObject* parent = NULL); QGroundControlQmlGlobal(QObject* parent = NULL);
~QGroundControlQmlGlobal(); ~QGroundControlQmlGlobal();
Q_PROPERTY(HomePositionManager* homePositionManager READ homePositionManager CONSTANT) Q_PROPERTY(HomePositionManager* homePositionManager READ homePositionManager CONSTANT)
Q_PROPERTY(FlightMapSettings* flightMapSettings READ flightMapSettings CONSTANT) Q_PROPERTY(FlightMapSettings* flightMapSettings READ flightMapSettings CONSTANT)
Q_PROPERTY(qreal zOrderTopMost READ zOrderTopMost CONSTANT) ///< z order for top most items, toolbar, main window sub view
Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss
Q_PROPERTY(qreal zOrderMapItems READ zOrderMapItems CONSTANT) ///< z order value for map items, for example: mission item indicators
// Property accesors // Property accesors
HomePositionManager* homePositionManager(void) { return _homePositionManager; } HomePositionManager* homePositionManager () { return _homePositionManager; }
FlightMapSettings* flightMapSettings(void) { return _flightMapSettings; } FlightMapSettings* flightMapSettings () { return _flightMapSettings; }
qreal zOrderTopMost () { return 1000; }
qreal zOrderWidgets () { return 100; }
qreal zOrderMapItems () { return 50; }
private: private:
HomePositionManager* _homePositionManager; HomePositionManager* _homePositionManager;
FlightMapSettings* _flightMapSettings; FlightMapSettings* _flightMapSettings;
......
...@@ -28,6 +28,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. ...@@ -28,6 +28,7 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QGroundControl 1.0
import QGroundControl.AutoPilotPlugin 1.0 import QGroundControl.AutoPilotPlugin 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
...@@ -37,7 +38,7 @@ import QGroundControl.MultiVehicleManager 1.0 ...@@ -37,7 +38,7 @@ import QGroundControl.MultiVehicleManager 1.0
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: qgcPal.window color: qgcPal.window
z: zOrder // zOrder comes from the Loader in MainWindow.qml z: QGroundControl.zOrderTopMost
QGCPalette { id: qgcPal; colorGroupEnabled: true } QGCPalette { id: qgcPal; colorGroupEnabled: true }
......
...@@ -25,6 +25,7 @@ import QtQuick 2.3 ...@@ -25,6 +25,7 @@ import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtPositioning 5.2 import QtPositioning 5.2
import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0 import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
...@@ -46,7 +47,6 @@ Item { ...@@ -46,7 +47,6 @@ Item {
flightView.visible = true flightView.visible = true
setupViewLoader.visible = false setupViewLoader.visible = false
planViewLoader.visible = false planViewLoader.visible = false
_root.hideWidgets = false
} }
onShowPlanView: { onShowPlanView: {
...@@ -56,7 +56,6 @@ Item { ...@@ -56,7 +56,6 @@ Item {
flightView.visible = false flightView.visible = false
setupViewLoader.visible = false setupViewLoader.visible = false
planViewLoader.visible = true planViewLoader.visible = true
_root.hideWidgets = true
} }
onShowSetupView: { onShowSetupView: {
...@@ -66,7 +65,6 @@ Item { ...@@ -66,7 +65,6 @@ Item {
flightView.visible = false flightView.visible = false
setupViewLoader.visible = true setupViewLoader.visible = true
planViewLoader.visible = false planViewLoader.visible = false
_root.hideWidgets = true
} }
onShowToolbarMessage: _toolbar.showToolbarMessage(message) onShowToolbarMessage: _toolbar.showToolbarMessage(message)
...@@ -88,7 +86,7 @@ Item { ...@@ -88,7 +86,7 @@ Item {
id: toolbarLoader id: toolbarLoader
width: parent.width width: parent.width
height: item ? item.height : 0 height: item ? item.height : 0
z: _root.zOrderTopMost z: QGroundControl.zOrderTopMost
} }
FlightDisplayView { FlightDisplayView {
...@@ -98,8 +96,6 @@ Item { ...@@ -98,8 +96,6 @@ Item {
anchors.top: toolbarLoader.bottom anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: true visible: true
property real zOrder: _root.zOrderTopMost
} }
Loader { Loader {
...@@ -109,8 +105,6 @@ Item { ...@@ -109,8 +105,6 @@ Item {
anchors.top: toolbarLoader.bottom anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: false visible: false
property real zOrder: _root.zOrderTopMost
} }
Loader { Loader {
...@@ -120,7 +114,5 @@ Item { ...@@ -120,7 +114,5 @@ Item {
anchors.top: toolbarLoader.bottom anchors.top: toolbarLoader.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: false visible: false
property real zOrder: _root.zOrderTopMost
} }
} }
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