summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2016-05-13 14:36:06 (GMT)
committerMarco Martin <notmart@gmail.com>2016-05-13 14:36:06 (GMT)
commit4bb05056cea8daf6660b5a8cb4a0424496c38453 (patch)
tree8b00f76dc0cbde2d5a14e5afbdfca5b2fe9aec02
parent6fe6e884d1b4133e92e35dc34fb3db71e1c5d6b7 (diff)
support zoom by ctrl+wheel
-rw-r--r--mobile/components/DocumentView.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/mobile/components/DocumentView.qml b/mobile/components/DocumentView.qml
index 5cc2086..68a0492 100644
--- a/mobile/components/DocumentView.qml
+++ b/mobile/components/DocumentView.qml
@@ -84,6 +84,7 @@ QtControls.ScrollView {
initialHeight * pinch.scale < flick.height * 3) {
mouseArea.scale = pinch.scale;
}
+ resizeTimer.stop();
flick.returnToBounds();
}
onPinchFinished: {
@@ -146,6 +147,13 @@ QtControls.ScrollView {
root.clicked();
}
}
+ onWheel: {
+ if (wheel.modifiers & Qt.ControlModifier) {
+ var factor = (wheel.angleDelta.y / 120) * 1.2;
+ flick.resizeContent(flick.contentWidth * factor, flick.contentHeight * factor, Qt.point(wheel.x, wheel.y));
+ resizeTimer.stop();
+ }
+ }
PageView {
id: page1