diff options
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() { |