summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-07 12:52:18 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-07 12:52:18 +0200
commit2ddea19fbb39dc35efd0e868233dc3ddf8f2a451 (patch)
tree669fb0879bad059960023b20c4cd766bb0df7b3b /src/webview.cpp
parentoops.. one line more.. (diff)
parentFix the end value of the zoom slider with mouse wheel zoom (diff)
downloadrekonq-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.cpp25
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);
+
+
}