diff options
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 441225af..c15478c2 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -47,6 +47,7 @@ #include <KMenu> #include <KActionMenu> #include <ktoolinvocation.h> +#include <KStandardDirs> // Qt Includes #include <QtCore/QDir> @@ -316,7 +317,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(mainwindow->actionByName(KStandardAction::name(KStandardAction::SaveAs))); - if (ReKonfig::kgetList()) + if (!KStandardDirs::findExe("kget").isNull() && ReKonfig::kgetList()) { a = new KAction(KIcon("kget"), i18n("List All Links"), this); connect(a, SIGNAL(triggered(bool)), page(), SLOT(downloadAllContentsWithKGet())); @@ -536,13 +537,11 @@ void WebView::keyPressEvent(QKeyEvent *event) } - - - void WebView::wheelEvent(QWheelEvent *event) { - if (!ReKonfig::smoothScrolling() || page()->currentFrame()->hitTestContent(event->pos()).isContentEditable()) - KWebView::wheelEvent(event); + // To let some websites (eg: google maps) to handle wheel events + int ypos = page()->currentFrame()->scrollPosition().y(); + KWebView::wheelEvent(event); // Sync with the zoom slider if (event->modifiers() == Qt::ControlModifier) @@ -560,8 +559,10 @@ void WebView::wheelEvent(QWheelEvent *event) emit zoomChanged(newFactor); } - else if ( ReKonfig::smoothScrolling() && !page()->currentFrame()->hitTestContent(event->pos()).isContentEditable()) + else if (ReKonfig::smoothScrolling() && ypos != page()->currentFrame()->scrollPosition().y()) { + page()->currentFrame()->setScrollPosition(QPoint(page()->currentFrame()->scrollPosition().x(), ypos)); + int numDegrees = event->delta() / 8; int numSteps = numDegrees / 15; |