Commit 23ad3af0 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4925 from DonLakeFlyer/Bugs

Bugs
parents dcc5642d fa23e1d0
......@@ -46,7 +46,6 @@ FlightMap {
property bool _disableVehicleTracking: false
property bool _keepVehicleCentered: _mainIsMap ? false : true
// Track last known map position and zoom from Fly view in settings
onZoomLevelChanged: QGroundControl.flightMapZoom = zoomLevel
onCenterChanged: QGroundControl.flightMapPosition = center
......@@ -209,11 +208,11 @@ FlightMap {
// Add trajectory points to the map
MapItemView {
model: _mainIsMap ? _activeVehicle ? _activeVehicle.trajectoryPoints : 0 : 0
delegate:
MapPolyline {
delegate: MapPolyline {
line.width: 3
line.color: "red"
z: QGroundControl.zOrderMapItems - 2
z: QGroundControl.zOrderTrajectoryLines
path: [
object.coordinate1,
object.coordinate2,
......@@ -224,13 +223,13 @@ FlightMap {
// Add the vehicles to the map
MapItemView {
model: QGroundControl.multiVehicleManager.vehicles
delegate:
VehicleMapItem {
delegate: VehicleMapItem {
vehicle: object
coordinate: object.coordinate
isSatellite: flightMap.isSatelliteMap
size: _mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
z: QGroundControl.zOrderMapItems - 1
z: QGroundControl.zOrderVehicles
}
}
......@@ -246,7 +245,7 @@ FlightMap {
// Add lines between waypoints
MissionLineView {
model: _mainIsMap ? missionController.waypointLines : 0
model: _mainIsMap ? missionController.waypointLines : 0
}
GeoFenceMapVisuals {
......
......@@ -24,7 +24,7 @@ MapItemView {
delegate: MapPolyline {
line.width: 3
line.color: "#be781c" // Hack, can't get palette to work in here
z: QGroundControl.zOrderMapItems - 1 // Under item indicators
z: QGroundControl.zOrderWaypointLines
path: [
object.coordinate1,
......
......@@ -45,9 +45,17 @@ Rectangle {
colorGroupEnabled: enabled
}
MouseArea {
FocusScope {
id: currentItemScope
anchors.fill: parent
onClicked: _root.clicked()
MouseArea {
anchors.fill: parent
onClicked: {
currentItemScope.focus = true
_root.clicked()
}
}
}
QGCLabel {
......@@ -76,7 +84,14 @@ Rectangle {
QGCMouseArea {
fillItem: hamburger
visible: hamburger.visible
onClicked: _waypointsOnlyMode ? waypointsOnlyMenu.popup() : normalMenu.popup()
onClicked: {
currentItemScope.focus = true
if (_waypointsOnlyMode) {
waypointsOnlyMenu.popup()
} else {
normalMenu.popup()
}
}
Menu {
id: normalMenu
......
......@@ -6,12 +6,11 @@ import QtGraphicalEffects 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
QGCMouseArea {
FocusScope {
id: _root
anchors.left: parent.left
anchors.right: parent.right
height: column.height
onClicked: checked = !checked
property alias text: label.text
property bool checked: true
......@@ -27,38 +26,47 @@ QGCMouseArea {
QGCPalette { id: qgcPal; colorGroupEnabled: true }
ColumnLayout {
id: column
anchors.left: parent.left
anchors.right: parent.right
QGCMouseArea {
anchors.fill: parent
Item {
height: _sectionSpacer
width: 1
visible: showSpacer
onClicked: {
_root.focus = true
checked = !checked
}
QGCLabel {
id: label
Layout.fillWidth: true
ColumnLayout {
id: column
anchors.left: parent.left
anchors.right: parent.right
QGCColoredImage {
id: image
width: label.height / 2
height: width
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: "/qmlimages/arrow-down.png"
color: qgcPal.text
visible: !_root.checked
Item {
height: _sectionSpacer
width: 1
visible: showSpacer
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: qgcPal.text
QGCLabel {
id: label
Layout.fillWidth: true
QGCColoredImage {
id: image
width: label.height / 2
height: width
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
source: "/qmlimages/arrow-down.png"
color: qgcPal.text
visible: !_root.checked
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: 1
color: qgcPal.text
}
}
}
}
......@@ -68,7 +68,10 @@ Button {
}
}
onClicked: popup.toggleShow()
onClicked: {
combo.focus = true
popup.toggleShow()
}
Component.onCompleted: {
if (currentIndex === -1) {
......
......@@ -51,9 +51,13 @@ public:
Q_PROPERTY(int supportedFirmwareCount READ supportedFirmwareCount 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
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)
Q_PROPERTY(qreal zOrderVehicles READ zOrderVehicles CONSTANT)
Q_PROPERTY(qreal zOrderWaypointIndicators READ zOrderWaypointIndicators CONSTANT)
Q_PROPERTY(qreal zOrderTrajectoryLines READ zOrderTrajectoryLines CONSTANT)
Q_PROPERTY(qreal zOrderWaypointLines READ zOrderWaypointLines CONSTANT)
//-------------------------------------------------------------------------
// MavLink Protocol
......@@ -135,9 +139,13 @@ public:
static QGeoCoordinate flightMapPosition ();
static double flightMapZoom ();
qreal zOrderTopMost () { return 1000; }
qreal zOrderWidgets () { return 100; }
qreal zOrderMapItems () { return 50; }
qreal zOrderTopMost () { return 1000; }
qreal zOrderWidgets () { return 100; }
qreal zOrderMapItems () { return 50; }
qreal zOrderWaypointIndicators () { return 50; }
qreal zOrderVehicles () { return 49; }
qreal zOrderTrajectoryLines () { return 48; }
qreal zOrderWaypointLines () { return 47; }
bool isVersionCheckEnabled () { return _toolbox->mavlinkProtocol()->versionCheckEnabled(); }
int mavlinkSystemID () { return _toolbox->mavlinkProtocol()->getSystemId(); }
......
......@@ -163,71 +163,77 @@ Rectangle {
visible: index == 0 ? _showOptionalElements : true
}
Rectangle {
FocusScope {
id: scope
anchors.left: parent.left
anchors.right: parent.right
height: width
color: checked ? _repeaterPal.buttonHighlight : _repeaterPal.button
QGCColoredImage {
id: button
anchors.fill: parent
source: _source
sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
color: checked ? _repeaterPal.buttonHighlightText : _repeaterPal.buttonText
RotationAnimation on rotation {
id: imageRotation
loops: Animation.Infinite
from: 0
to: 360
duration: 500
running: false
}
NumberAnimation on opacity {
id: opacityAnimation
running: false
from: 0
to: 1.0
loops: Animation.Infinite
duration: 2000
Rectangle {
anchors.fill: parent
color: checked ? _repeaterPal.buttonHighlight : _repeaterPal.button
QGCColoredImage {
id: button
anchors.fill: parent
source: _source
sourceSize.height: parent.height
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
color: checked ? _repeaterPal.buttonHighlightText : _repeaterPal.buttonText
RotationAnimation on rotation {
id: imageRotation
loops: Animation.Infinite
from: 0
to: 360
duration: 500
running: false
}
NumberAnimation on opacity {
id: opacityAnimation
running: false
from: 0
to: 1.0
loops: Animation.Infinite
duration: 2000
}
}
}
QGCMouseArea {
// Size of mouse area is expanded to make touch easier
anchors.leftMargin: -buttonStripColumn.anchors.margins
anchors.rightMargin: -buttonStripColumn.anchors.margins
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
height: parent.height + (_showOptionalElements? buttonLabel.height + buttonColumn.spacing : 0)
visible: _buttonEnabled
preventStealing: true
onClicked: {
if (modelData.dropPanelComponent === undefined) {
dropPanel.hide()
if (modelData.toggle === true) {
checked = !checked
} else {
// dropPanel.hide above will close panel, but we need to do this to clear toggles
uncheckAll()
}
_root.clicked(index, checked)
} else {
if (checked) {
dropPanel.hide() // hide affects checked, so this needs to be duplicated inside not outside if
QGCMouseArea {
// Size of mouse area is expanded to make touch easier
anchors.leftMargin: -buttonStripColumn.anchors.margins
anchors.rightMargin: -buttonStripColumn.anchors.margins
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
height: parent.height + (_showOptionalElements? buttonLabel.height + buttonColumn.spacing : 0)
visible: _buttonEnabled
preventStealing: true
onClicked: {
scope.focus = true
if (modelData.dropPanelComponent === undefined) {
dropPanel.hide()
if (modelData.toggle === true) {
checked = !checked
} else {
// dropPanel.hide above will close panel, but we need to do this to clear toggles
uncheckAll()
}
_root.clicked(index, checked)
} else {
dropPanel.hide() // hide affects checked, so this needs to be duplicated inside not outside if
uncheckAll()
checked = true
var panelEdgeTopPoint = mapToItem(_root, width, 0)
dropPanel.show(panelEdgeTopPoint, height, modelData.dropPanelComponent)
if (checked) {
dropPanel.hide() // hide affects checked, so this needs to be duplicated inside not outside if
} else {
dropPanel.hide() // hide affects checked, so this needs to be duplicated inside not outside if
uncheckAll()
checked = true
var panelEdgeTopPoint = mapToItem(_root, width, 0)
dropPanel.show(panelEdgeTopPoint, height, modelData.dropPanelComponent)
}
}
}
}
......
......@@ -345,17 +345,6 @@ QGCView {
anchors.fill: parent
}
CenterMapDropButton {
anchors.margins: _margins
anchors.left: parent.left
anchors.top: parent.top
map: _map
z: QGroundControl.zOrderTopMost
showMission: false
showAllItems: false
visible: addNewSetView.visible
}
MapScale {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.bottomMargin: anchors.leftMargin
......@@ -602,6 +591,17 @@ QGCView {
} // Map
}
} // Item - Add new set view
CenterMapDropButton {
topMargin: 0
anchors.margins: _margins
anchors.left: map.left
anchors.top: map.top
map: _map
showMission: false
showAllItems: false
visible: addNewSetView.visible
}
} // Map
//-- Add new set dialog
......
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