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/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