From f084852f5c71624033862242b23579feeac03cb8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 24 Mar 2020 15:30:44 -0700 Subject: mobile/debug: simulate zooming through mouse wheel on desktop And allow touchpad gestures to be recognized as well. This has no negative impact on the mobile platforms, but makes it much easier to test profile scaling / panning on the desktop. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetailsView.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index c07cce038..3eb0ec2d2 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -277,6 +277,16 @@ Item { // pass events through to the parent and eventually into the ListView propagateComposedEvents: true + // for testing / debugging on a desktop + scrollGestureEnabled: true + onWheel: { + manager.appendTextToLog("wheel " + wheel.angleDelta) + if (wheel.angleDelta.y > 0) + qmlProfile.scale += 0.2 + if (wheel.angleDelta.y < 0 && qmlProfile.scale > 1.1) + qmlProfile.scale -= 0.2 + } + anchors.fill: parent drag.target: qmlProfile drag.axis: Drag.XAndYAxis -- cgit v1.2.3-70-g09d2