diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-05-30 16:50:36 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-05-30 16:53:42 +0200 |
commit | 8765137a9ec0547b9edf3cb3b9ebae88a7043c2e (patch) | |
tree | ab87713795436cca9a903ca1f21d36bc192ba333 /src/webview.cpp | |
parent | Merge branch 'master' of gitorious.org:rekonq/mainline (diff) | |
download | rekonq-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.cpp | 17 |
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() { |