From 1bdc7d606d17185068501a3ced5b92aa2bede274 Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Fri, 24 Feb 2017 12:43:23 -0500 Subject: [PATCH] Disable scrolling on QGCComboBox --- src/QmlControls/QGCComboBox.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml index 116ffb0e6..8b00e725d 100644 --- a/src/QmlControls/QGCComboBox.qml +++ b/src/QmlControls/QGCComboBox.qml @@ -39,4 +39,24 @@ ComboBox { } } } + + // Capture Wheel events to disable scrolling options in ComboBox. + // As a side effect, this also prevents scrolling the page when + // mouse is over a ComboBox, but this would also the case when + // scrolling items in the ComboBox is enabled. + MouseArea { + anchors.fill: parent + onWheel: { + // do nothing + wheel.accepted = true; + } + onPressed: { + // propogate to ComboBox + mouse.accepted = false; + } + onReleased: { + // propogate to ComboBox + mouse.accepted = false; + } + } } -- 2.22.0