Commit 60fbc492 authored by Gus Grubba's avatar Gus Grubba

Create a "Dead Mouse Area" control to eat mouse events underneath desired...

Create a "Dead Mouse Area" control to eat mouse events underneath desired area. This is to prevent mouse events from leaking through controls underneath the area.
Replace original "NoMouseThroughRectangle" as this is more versatile.
Prevent mouse through events from leaking underneath the Fly View tool strip.
parent 299fde42
This diff is collapsed.
...@@ -16,7 +16,7 @@ import QGroundControl.Controls 1.0 ...@@ -16,7 +16,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
/// Guided actions confirmation dialog /// Guided actions confirmation dialog
NoMouseThroughRectangle { Rectangle {
id: _root id: _root
border.color: qgcPal.alertBorder border.color: qgcPal.alertBorder
border.width: 1 border.width: 1
...@@ -48,6 +48,10 @@ NoMouseThroughRectangle { ...@@ -48,6 +48,10 @@ NoMouseThroughRectangle {
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
Column { Column {
id: confirmColumn id: confirmColumn
anchors.margins: _margins anchors.margins: _margins
......
...@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0 ...@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
/// Dialog showing list of available guided actions /// Dialog showing list of available guided actions
NoMouseThroughRectangle { Rectangle {
id: _root id: _root
width: actionColumn.width + (_margins * 4) width: actionColumn.width + (_margins * 4)
height: actionColumn.height + (_margins * 4) height: actionColumn.height + (_margins * 4)
...@@ -35,6 +35,10 @@ NoMouseThroughRectangle { ...@@ -35,6 +35,10 @@ NoMouseThroughRectangle {
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
ColumnLayout { ColumnLayout {
id: actionColumn id: actionColumn
anchors.margins: _root._margins anchors.margins: _root._margins
......
...@@ -28,7 +28,7 @@ Item { ...@@ -28,7 +28,7 @@ Item {
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
NoMouseThroughRectangle { Rectangle {
id: mvCommands id: mvCommands
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
...@@ -37,6 +37,10 @@ Item { ...@@ -37,6 +37,10 @@ Item {
opacity: _rectOpacity opacity: _rectOpacity
radius: _margin radius: _margin
DeadMouseArea {
anchors.fill: parent
}
Column { Column {
id: mvCommandsColumn id: mvCommandsColumn
anchors.margins: _margin anchors.margins: _margin
......
...@@ -84,11 +84,8 @@ Rectangle { ...@@ -84,11 +84,8 @@ Rectangle {
} }
//-- Eat mouse events, preventing them from reaching toolbar, which is underneath us. //-- Eat mouse events, preventing them from reaching toolbar, which is underneath us.
MouseArea { DeadMouseArea {
anchors.fill: parent anchors.fill: parent
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
} }
//-- The reason for this Row to be here is so the Logo (Home) button is in the same //-- The reason for this Row to be here is so the Logo (Home) button is in the same
......
import QtQuick 2.3
import QtQuick.Controls 1.2
MouseArea {
preventStealing:true
hoverEnabled: true
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
}
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; }
}
}
...@@ -5,6 +5,7 @@ AppMessages 1.0 AppMessages.qml ...@@ -5,6 +5,7 @@ AppMessages 1.0 AppMessages.qml
CameraCalc 1.0 CameraCalc.qml CameraCalc 1.0 CameraCalc.qml
CameraSection 1.0 CameraSection.qml CameraSection 1.0 CameraSection.qml
ClickableColor 1.0 ClickableColor.qml ClickableColor 1.0 ClickableColor.qml
DeadMouseArea 1.0 DeadMouseArea.qml
DropButton 1.0 DropButton.qml DropButton 1.0 DropButton.qml
DropPanel 1.0 DropPanel.qml DropPanel 1.0 DropPanel.qml
EditPositionDialog 1.0 EditPositionDialog.qml EditPositionDialog 1.0 EditPositionDialog.qml
...@@ -27,15 +28,11 @@ MissionItemMapVisual 1.0 MissionItemMapVisual.qml ...@@ -27,15 +28,11 @@ MissionItemMapVisual 1.0 MissionItemMapVisual.qml
MissionItemStatus 1.0 MissionItemStatus.qml MissionItemStatus 1.0 MissionItemStatus.qml
ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml
MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml
NoMouseThroughRectangle 1.0 NoMouseThroughRectangle.qml OfflineMapButton 1.0 OfflineMapButton.qml
PageView 1.0 PageView.qml PageView 1.0 PageView.qml
ParameterEditor 1.0 ParameterEditor.qml ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PlanToolBar 1.0 PlanToolBar.qml PlanToolBar 1.0 PlanToolBar.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
QGCButton 1.0 QGCButton.qml QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml QGCColoredImage 1.0 QGCColoredImage.qml
...@@ -45,8 +42,8 @@ QGCFlickable 1.0 QGCFlickable.qml ...@@ -45,8 +42,8 @@ QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.qml QGCGroupBox 1.0 QGCGroupBox.qml
QGCLabel 1.0 QGCLabel.qml QGCLabel 1.0 QGCLabel.qml
QGCListView 1.0 QGCListView.qml QGCListView 1.0 QGCListView.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml
QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml
QGCMouseArea 1.0 QGCMouseArea.qml QGCMouseArea 1.0 QGCMouseArea.qml
...@@ -62,6 +59,10 @@ QGCViewDialog 1.0 QGCViewDialog.qml ...@@ -62,6 +59,10 @@ QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml
QGCViewMessage 1.0 QGCViewMessage.qml QGCViewMessage 1.0 QGCViewMessage.qml
QGCViewPanel 1.0 QGCViewPanel.qml QGCViewPanel 1.0 QGCViewPanel.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
RoundButton 1.0 RoundButton.qml RoundButton 1.0 RoundButton.qml
SectionHeader 1.0 SectionHeader.qml SectionHeader 1.0 SectionHeader.qml
SetupPage 1.0 SetupPage.qml SetupPage 1.0 SetupPage.qml
...@@ -74,4 +75,3 @@ ToolStrip 1.0 ToolStrip.qml ...@@ -74,4 +75,3 @@ ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml ViewWidget 1.0 ViewWidget.qml
OfflineMapButton 1.0 OfflineMapButton.qml
...@@ -52,6 +52,10 @@ Rectangle { ...@@ -52,6 +52,10 @@ Rectangle {
} }
} }
DeadMouseArea {
anchors.fill: parent
}
Column { Column {
id: buttonStripColumn id: buttonStripColumn
anchors.margins: ScreenTools.defaultFontPixelWidth / 2 anchors.margins: ScreenTools.defaultFontPixelWidth / 2
......
...@@ -654,11 +654,9 @@ QGCView { ...@@ -654,11 +654,9 @@ QGCView {
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85)
radius: ScreenTools.defaultFontPixelWidth * 0.5 radius: ScreenTools.defaultFontPixelWidth * 0.5
MouseArea { //-- Eat mouse events
anchors.fill: parent DeadMouseArea {
onWheel: { wheel.accepted = true; } anchors.fill: parent
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
} }
QGCLabel { QGCLabel {
......
...@@ -296,13 +296,10 @@ Item { ...@@ -296,13 +296,10 @@ Item {
onVtolTransitionToMRFlight: flightView.guidedController.confirmAction(flightView.guidedController.actionVtolTransitionToMRFlight) onVtolTransitionToMRFlight: flightView.guidedController.confirmAction(flightView.guidedController.actionVtolTransitionToMRFlight)
//-- Entire tool bar area disable on cammand //-- Entire tool bar area disable on cammand
MouseArea { DeadMouseArea {
id: toolbarBlocker id: toolbarBlocker
anchors.fill: parent
enabled: false enabled: false
onWheel: { wheel.accepted = true; } anchors.fill: parent
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
} }
} }
......
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