diff options
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 878a7403..061dd256 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -316,7 +316,7 @@ void WebView::mousePressEvent(QMouseEvent *event) } QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos()); - _canEnableAutoScroll = !ReKonfig::disableAutoScroll() && !result.isContentEditable() && result.linkUrl().isEmpty(); + _canEnableAutoScroll = ReKonfig::autoScroll() && !result.isContentEditable() && result.linkUrl().isEmpty(); switch (event->button()) { @@ -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() { |