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
import QGroundControl.Palette 1.0
/// Guided actions confirmation dialog
NoMouseThroughRectangle {
Rectangle {
id: _root
border.color: qgcPal.alertBorder
border.width: 1
......@@ -48,6 +48,10 @@ NoMouseThroughRectangle {
QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
Column {
id: confirmColumn
anchors.margins: _margins
......
......@@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
/// Dialog showing list of available guided actions
NoMouseThroughRectangle {
Rectangle {
id: _root
width: actionColumn.width + (_margins * 4)
height: actionColumn.height + (_margins * 4)
......@@ -35,6 +35,10 @@ NoMouseThroughRectangle {
QGCPalette { id: qgcPal }
DeadMouseArea {
anchors.fill: parent
}
ColumnLayout {
id: actionColumn
anchors.margins: _root._margins
......
......@@ -28,7 +28,7 @@ Item {
QGCPalette { id: qgcPal }
NoMouseThroughRectangle {
Rectangle {
id: mvCommands
anchors.left: parent.left
anchors.right: parent.right
......@@ -37,6 +37,10 @@ Item {
opacity: _rectOpacity
radius: _margin
DeadMouseArea {
anchors.fill: parent
}
Column {
id: mvCommandsColumn
anchors.margins: _margin
......
......@@ -84,11 +84,8 @@ Rectangle {
}
//-- Eat mouse events, preventing them from reaching toolbar, which is underneath us.
MouseArea {
DeadMouseArea {
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
......
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
CameraCalc 1.0 CameraCalc.qml
CameraSection 1.0 CameraSection.qml
ClickableColor 1.0 ClickableColor.qml
DeadMouseArea 1.0 DeadMouseArea.qml
DropButton 1.0 DropButton.qml
DropPanel 1.0 DropPanel.qml
EditPositionDialog 1.0 EditPositionDialog.qml
......@@ -27,15 +28,11 @@ 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
OfflineMapButton 1.0 OfflineMapButton.qml
PageView 1.0 PageView.qml
ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.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
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
......@@ -45,8 +42,8 @@ QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.qml
QGCLabel 1.0 QGCLabel.qml
QGCListView 1.0 QGCListView.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml
QGCMapLabel 1.0 QGCMapLabel.qml
QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml
QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml
QGCMouseArea 1.0 QGCMouseArea.qml
......@@ -62,6 +59,10 @@ QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml
QGCViewMessage 1.0 QGCViewMessage.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
SectionHeader 1.0 SectionHeader.qml
SetupPage 1.0 SetupPage.qml
......@@ -74,4 +75,3 @@ ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml
OfflineMapButton 1.0 OfflineMapButton.qml
......@@ -52,6 +52,10 @@ Rectangle {
}
}
DeadMouseArea {
anchors.fill: parent
}
Column {
id: buttonStripColumn
anchors.margins: ScreenTools.defaultFontPixelWidth / 2
......
......@@ -654,11 +654,9 @@ QGCView {
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85)
radius: ScreenTools.defaultFontPixelWidth * 0.5
MouseArea {
//-- Eat mouse events
DeadMouseArea {
anchors.fill: parent
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
}
QGCLabel {
......
......@@ -296,13 +296,10 @@ Item {
onVtolTransitionToMRFlight: flightView.guidedController.confirmAction(flightView.guidedController.actionVtolTransitionToMRFlight)
//-- Entire tool bar area disable on cammand
MouseArea {
DeadMouseArea {
id: toolbarBlocker
anchors.fill: parent
enabled: false
onWheel: { wheel.accepted = true; }
onPressed: { mouse.accepted = true; }
onReleased: { mouse.accepted = true; }
anchors.fill: parent
}
}
......
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