summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-05-30 16:50:36 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-05-30 16:53:42 +0200
commit8765137a9ec0547b9edf3cb3b9ebae88a7043c2e (patch)
treeab87713795436cca9a903ca1f21d36bc192ba333 /src/webview.cpp
parentMerge branch 'master' of gitorious.org:rekonq/mainline (diff)
downloadrekonq-8765137a9ec0547b9edf3cb3b9ebae88a7043c2e.tar.xz
- Sync mouse wheel zoom and the slider
- Fix mouse wheel zoom limits (slider's max and min)
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index a26cf63f..061dd256 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -496,6 +496,23 @@ void WebView::keyPressEvent(QKeyEvent *event)
KWebView::keyPressEvent(event);
}
+void WebView::wheelEvent(QWheelEvent *event)
+{
+ // Sync with the zoom slider
+ if (event->modifiers() == Qt::ControlModifier)
+ {
+ emit zoomChanged(zoomFactor());
+ }
+
+ KWebView::wheelEvent(event);
+
+ // Limits of the slider
+ if (zoomFactor() > 1.9)
+ setZoomFactor(1.9);
+ else if (zoomFactor() < 0.1)
+ setZoomFactor(0.1);
+}
+
void WebView::inspect()
{