diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-03-24 15:30:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-25 09:28:05 -0700 |
commit | f084852f5c71624033862242b23579feeac03cb8 (patch) | |
tree | e087e4569e2f098abe1429d471a1fad369c6fe8e /mobile-widgets/qml | |
parent | 93ab1232f0bb62748e8ed28f970f90574042d203 (diff) | |
download | subsurface-f084852f5c71624033862242b23579feeac03cb8.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DiveDetailsView.qml | 10 |
1 files changed, 10 insertions, 0 deletions
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 |