summaryrefslogtreecommitdiff
path: root/src/location/maps/MapView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/maps/MapView.qml')
-rw-r--r--src/location/maps/MapView.qml17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/location/maps/MapView.qml b/src/location/maps/MapView.qml
index 76af2d65..70d2105e 100644
--- a/src/location/maps/MapView.qml
+++ b/src/location/maps/MapView.qml
@@ -103,9 +103,24 @@ Item {
}
WheelHandler {
id: wheel
+ // workaround for QTBUG-87646 / QTBUG-112394:
+ // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler
+ acceptedDevices: Qt.platform.pluginName === "cocoa"
+ ? PointerDevice.Mouse | PointerDevice.TouchPad
+ : PointerDevice.Mouse
onWheel: (event) => {
const loc = map.toCoordinate(wheel.point.position)
- map.zoomLevel += event.angleDelta.y / 120
+ switch (event.modifiers) {
+ case Qt.NoModifier:
+ map.zoomLevel += event.angleDelta.y / 120
+ break
+ case Qt.ShiftModifier:
+ map.bearing += event.angleDelta.y / 15
+ break
+ case Qt.ControlModifier:
+ map.tilt += event.angleDelta.y / 15
+ break
+ }
map.alignCoordinateToPoint(loc, wheel.point.position)
}
}