diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-06-07 12:52:18 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-06-07 12:52:18 +0200 |
commit | 2ddea19fbb39dc35efd0e868233dc3ddf8f2a451 (patch) | |
tree | 669fb0879bad059960023b20c4cd766bb0df7b3b /src/webview.cpp | |
parent | oops.. one line more.. (diff) | |
parent | Fix the end value of the zoom slider with mouse wheel zoom (diff) | |
download | rekonq-2ddea19fbb39dc35efd0e868233dc3ddf8f2a451.tar.xz |
Merge commit 'refs/merge-requests/133' of git://gitorious.org/rekonq/mainline into m133
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 061dd256..0633bc9b 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -498,19 +498,30 @@ void WebView::keyPressEvent(QKeyEvent *event) void WebView::wheelEvent(QWheelEvent *event) { + KWebView::wheelEvent(event); + + // Sync with the zoom slider if (event->modifiers() == Qt::ControlModifier) { - emit zoomChanged(zoomFactor()); + // Limits of the slider + if (zoomFactor() > 1.9) + setZoomFactor(1.9); + else if (zoomFactor() < 0.1) + setZoomFactor(0.1); + + // Round the factor (Fix slider's end value) + int newFactor = zoomFactor() * 10; + if ((zoomFactor() * 10 - newFactor) > 0.5) + newFactor++; + + + emit zoomChanged((qreal)newFactor / 10); } - KWebView::wheelEvent(event); - // Limits of the slider - if (zoomFactor() > 1.9) - setZoomFactor(1.9); - else if (zoomFactor() < 0.1) - setZoomFactor(0.1); + + } |