summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2012-08-16 14:59:53 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2012-08-16 15:14:15 +0200
commit46152144132f5e915c8a4a90f903c4f477ebff15 (patch)
tree3c8893bbdef2fa75af5cc323741eaf8d814f8882 /src/webview.cpp
parentMake sure to add all MainWindow before a new tab. (diff)
downloadrekonq-46152144132f5e915c8a4a90f903c4f477ebff15.tar.xz
- Choose the correct MainView in ZoomBar::updateSlider()
It fixes issue for the first tab of new windows in case of a "wheel" zoom. - Move the zoom bounding logic from WebView::wheelEvent() to ZoomBar::setValue() It'll avoid Ctrl -/+ to exceed the max value of the slider - Use the round() method instead of my previous hack to compute zoom ratio for wheel events
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 00112d61..7272e2c2 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -864,17 +864,8 @@ void WebView::wheelEvent(QWheelEvent *event)
// Sync with the zoom slider
if (event->modifiers() == Qt::ControlModifier)
{
- // 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++;
-
+ int newFactor = round(zoomFactor() * 10);
emit zoomChanged(newFactor);
}
else if (ReKonfig::smoothScrolling() && prevPos != newPos)