diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index dfcda9c3f5165a89681fadaa4f28ad99a9f4eece..7c2fcf20375c7a3fa50152a89f6ecc1c0a5b710c 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -73,6 +73,7 @@ src/PlanView/MissionItemStatus.qml src/QmlControls/ModeSwitchDisplay.qml src/QmlControls/MultiRotorMotorDisplay.qml + src/QmlControls/NoMouseThroughRectangle.qml src/QmlControls/OfflineMapButton.qml src/QmlControls/ParameterEditor.qml src/QmlControls/ParameterEditorDialog.qml diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index 0a72adb6798d6be505cc22166217e3e96f1eff37..b410685cf07b5ce64cabd85a0fafd1b224657cfa 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -540,6 +540,7 @@ QGCView { id: guidedActionsController missionController: _missionController confirmDialog: guidedActionConfirm + actionList: guidedActionList altitudeSlider: _altitudeSlider z: _flightVideoPipControl.z + 1 diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index 3e38ee151f56202779f93afea5c40ea0819ec0dd..c8c844f667b486f72db9117e5e964f783986ec47 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -240,8 +240,9 @@ FlightMap { anchorPoint.y: sourceItem.anchorPointY sourceItem: MissionItemIndexLabel { - checked: true - label: qsTr("G", "Goto here waypoint") // second string is translator's hint. + checked: true + index: -1 + label: qsTr("Goto here", "Goto here waypoint") } } @@ -260,7 +261,7 @@ FlightMap { anchors.fill: parent onClicked: { - if (guidedActionsController.showGotoLocation) { + if (guidedActionsController.showGotoLocation && !guidedActionsController.guidedUIVisible) { _gotoHereCoordinate = flightMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */) guidedActionsController.confirmAction(guidedActionsController.actionGoto, _gotoHereCoordinate) } diff --git a/src/FlightDisplay/GuidedActionConfirm.qml b/src/FlightDisplay/GuidedActionConfirm.qml index 562298a6d95d933a111b5b5f480bac4978f924c0..48c159fa2e9cf0804683f9a2d7b7a77e176f6ece 100644 --- a/src/FlightDisplay/GuidedActionConfirm.qml +++ b/src/FlightDisplay/GuidedActionConfirm.qml @@ -16,7 +16,7 @@ import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 /// Guided actions confirmation dialog -Rectangle { +NoMouseThroughRectangle { id: _root border.color: qgcPal.alertBorder border.width: 1 diff --git a/src/FlightDisplay/GuidedActionList.qml b/src/FlightDisplay/GuidedActionList.qml index 6ff749c8faf0dcfc085a33a865204ac7c9d35ffb..4c002c3ce1137a02353932f17ae89dd20bd53948 100644 --- a/src/FlightDisplay/GuidedActionList.qml +++ b/src/FlightDisplay/GuidedActionList.qml @@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 /// Dialog showing list of available guided actions -Rectangle { +NoMouseThroughRectangle { id: _root width: actionColumn.width + (_margins * 4) height: actionColumn.height + (_margins * 4) diff --git a/src/FlightDisplay/GuidedActionsController.qml b/src/FlightDisplay/GuidedActionsController.qml index 05b9c9d1a8787d7f4d5a470d841eee4f537d1a53..c344287e27ad37359650925a32b470c7b9131d8f 100644 --- a/src/FlightDisplay/GuidedActionsController.qml +++ b/src/FlightDisplay/GuidedActionsController.qml @@ -29,6 +29,7 @@ Item { property var missionController property var confirmDialog + property var actionList property var altitudeSlider readonly property string emergencyStopTitle: qsTr("Emergency Stop") @@ -96,6 +97,8 @@ Item { property bool showLandAbort: _activeVehicle && _vehicleFlying && _activeVehicle.fixedWing && _vehicleLanding property bool showGotoLocation: _activeVehicle && _activeVehicle.guidedMode && _vehicleFlying + property bool guidedUIVisible: guidedActionConfirm.visible || guidedActionList.visible + property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property string _flightMode: _activeVehicle ? _activeVehicle.flightMode : "" property bool _missionAvailable: missionController.containsItems diff --git a/src/QmlControls/MissionItemIndexLabel.qml b/src/QmlControls/MissionItemIndexLabel.qml index ee16f25ea61fc788c2357d12db9afcf6404a3dc5..2b226e4be58145799cdf1e15b9471016c6a60e0a 100644 --- a/src/QmlControls/MissionItemIndexLabel.qml +++ b/src/QmlControls/MissionItemIndexLabel.qml @@ -13,7 +13,7 @@ Canvas { signal clicked property string label ///< Label to show to the side of the index indicator - property int index: 0 ///< Index to show in the indicator, 0 will show label instead + property int index: 0 ///< Index to show in the indicator, 0 will show single char label instead, -1 first char of label in indicator full label to the side property bool checked: false property bool small: false property var color: checked ? "green" : qgcPal.mapButtonHighlight @@ -33,7 +33,7 @@ Canvas { property real _labelMargin: 2 property real _labelRadius: _indicatorRadius + _labelMargin property string _label: index === 0 ? "" : label - property string _index: index === 0 ? label : index + property string _index: index === 0 || index === -1 ? label.charAt(0) : index onColorChanged: requestPaint() onShowGimbalYawChanged: requestPaint() diff --git a/src/QmlControls/NoMouseThroughRectangle.qml b/src/QmlControls/NoMouseThroughRectangle.qml new file mode 100644 index 0000000000000000000000000000000000000000..295f6e3c6d32be13989425702da3643b0638a117 --- /dev/null +++ b/src/QmlControls/NoMouseThroughRectangle.qml @@ -0,0 +1,14 @@ +import QtQuick 2.3 +import QtQuick.Controls 1.2 + +/// This control is used to create a Rectangle control which does not allow mouse events to bleed through to the control +/// which is beneath it. +Rectangle { + MouseArea { + anchors.fill: parent + preventStealing: true + onWheel: { wheel.accepted = true; } + onPressed: { mouse.accepted = true; } + onReleased: { mouse.accepted = true; } + } +} diff --git a/src/QmlControls/QGroundControl.Controls.qmldir b/src/QmlControls/QGroundControl.Controls.qmldir index 64be6551d20ea30d1b50b80ddf39a67d11eeb37f..b16c14e3478ed1842e80666dac1510735b5eda31 100644 --- a/src/QmlControls/QGroundControl.Controls.qmldir +++ b/src/QmlControls/QGroundControl.Controls.qmldir @@ -25,6 +25,7 @@ MissionItemMapVisual 1.0 MissionItemMapVisual.qml MissionItemStatus 1.0 MissionItemStatus.qml ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml +NoMouseThroughRectangle 1.0 NoMouseThroughRectangle.qml ParameterEditor 1.0 ParameterEditor.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml PlanToolBar 1.0 PlanToolBar.qml