summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 99c48f0b..061dd256 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -77,7 +77,7 @@ WebView::WebView(QWidget* parent)
// download system
connect(this, SIGNAL(linkShiftClicked(const KUrl &)), page, SLOT(downloadUrl(const KUrl &)));
- connect(page, SIGNAL(downloadRequested(const QNetworkRequest &)), page, SLOT(downloadThings(const QNetworkRequest &)));
+ connect(page, SIGNAL(downloadRequested(const QNetworkRequest &)), page, SLOT(downloadRequest(const QNetworkRequest &)));
// middle click || ctrl + click signal
connect(this, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), this, SLOT(loadUrlInNewTab(const KUrl &)));
@@ -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()
{