summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-08-17 15:07:02 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2010-08-17 15:07:02 +0200
commit6c2b8f0bdc4a3536c53a5f846e125b7dd9538749 (patch)
tree5e0874ff40e5f2148b35c67b5e84bb86ccfad973 /src/webview.cpp
parentMerge commit 'refs/merge-requests/172' of git://gitorious.org/rekonq/mainline... (diff)
downloadrekonq-6c2b8f0bdc4a3536c53a5f846e125b7dd9538749.tar.xz
- Fix an issue with some websites which need to handle wheel events (eg: google maps)
- Smooth scrolling now works on editable contents without sliders
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 441225af..7794e3bc 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -536,13 +536,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 +558,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;