From 1255296a1bdf0a2f4e3baa1992bb80d224f33941 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Wed, 3 Mar 2010 11:46:07 +0100 Subject: Fix the scroll problem with the workaround of findText() (spotted by Darjus Loktevic) --- src/mainwindow.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 39dd9a40..5df226df 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -795,8 +795,10 @@ void MainWindow::findNext() if(m_findBar->isHidden()) { - currentTab()->view()->page()->focusNextPrevChild(true); - return; + QPoint test = currentTab()->view()->page()->currentFrame()->scrollPosition(); + currentTab()->view()->page()->focusNextPrevChild(true); + currentTab()->view()->page()->currentFrame()->setScrollPosition(test); + return; } QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; @@ -806,7 +808,11 @@ void MainWindow::findNext() bool found = currentTab()->view()->findText(m_lastSearch, options); m_findBar->notifyMatch(found); if(!found) - currentTab()->view()->page()->focusNextPrevChild(true); + { + QPoint test = currentTab()->view()->page()->currentFrame()->scrollPosition(); + currentTab()->view()->page()->focusNextPrevChild(true); + currentTab()->view()->page()->currentFrame()->setScrollPosition(test); + } } @@ -821,8 +827,6 @@ void MainWindow::findPrevious() bool found = currentTab()->view()->findText(m_lastSearch, options); m_findBar->notifyMatch(found); - if(!found) - currentTab()->view()->page()->focusNextPrevChild(true); } -- cgit v1.2.1