summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-06 01:20:04 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-06 01:20:04 +0200
commit969efc9bddcc1b21d1c70f301d8cb0d44904c9c5 (patch)
tree7832edda27bab141c7247071f384bfb219298870 /src
parentThis commit is the first implementation of a new new new urlbar (diff)
downloadrekonq-969efc9bddcc1b21d1c70f301d8cb0d44904c9c5.tar.xz
I confused mouse cursor with the key one :)
Here is another hack to fix bug 211557 DISCLAIMER: this, as the previous, is an hack NOT a solution BUG: 211557
Diffstat (limited to 'src')
-rw-r--r--src/webview.cpp8
-rw-r--r--src/webview.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 2083cef3..e874411d 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -66,6 +66,7 @@ WebView::WebView(QWidget* parent)
, _scrollTimer( new QTimer(this) )
, _VScrollSpeed(0)
, _HScrollSpeed(0)
+ , _disableAutoScroll(false)
{
WebPage *page = new WebPage(this);
setPage(page);
@@ -320,6 +321,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
void WebView::mousePressEvent(QMouseEvent *event)
{
+ QWebHitTestResult result = page()->mainFrame()->hitTestContent( event->pos() );
+ _disableAutoScroll = result.isContentEditable();
+
switch(event->button())
{
case Qt::XButton1:
@@ -426,9 +430,7 @@ void WebView::keyPressEvent(QKeyEvent *event)
}
}
- QWebHitTestResult result = page()->mainFrame()->hitTestContent( mapFromGlobal( QCursor::pos() ) );
-
- if( result.isContentEditable() )
+ if(_disableAutoScroll)
{
KWebView::keyPressEvent(event);
return;
diff --git a/src/webview.h b/src/webview.h
index 85ebf46a..0fe83ae4 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -79,6 +79,7 @@ private:
QTimer *_scrollTimer;
int _VScrollSpeed;
int _HScrollSpeed;
+ bool _disableAutoScroll;
};
#endif