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 From 92baa8b9ff6171e391fdbc0f70b4ece24be4843f Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Wed, 3 Mar 2010 12:04:54 +0100 Subject: Fix the move of the page whith case sensitive --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5df226df..7c30198f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -783,7 +783,7 @@ void MainWindow::matchCaseUpdate() if (!currentTab()) return; - currentTab()->view()->findText(m_lastSearch, QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument); + currentTab()->view()->findText(m_lastSearch, QWebPage::FindBackward); findNext(); } -- cgit v1.2.1 From 479afef6b760849df654226861e264ddd735632d Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Wed, 3 Mar 2010 12:41:43 +0100 Subject: variable names ... --- src/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7c30198f..a6f1428f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -795,9 +795,9 @@ void MainWindow::findNext() if(m_findBar->isHidden()) { - QPoint test = currentTab()->view()->page()->currentFrame()->scrollPosition(); + QPoint previous_position = currentTab()->view()->page()->currentFrame()->scrollPosition(); currentTab()->view()->page()->focusNextPrevChild(true); - currentTab()->view()->page()->currentFrame()->setScrollPosition(test); + currentTab()->view()->page()->currentFrame()->setScrollPosition(previous_position); return; } @@ -809,9 +809,9 @@ void MainWindow::findNext() m_findBar->notifyMatch(found); if(!found) { - QPoint test = currentTab()->view()->page()->currentFrame()->scrollPosition(); + QPoint previous_position = currentTab()->view()->page()->currentFrame()->scrollPosition(); currentTab()->view()->page()->focusNextPrevChild(true); - currentTab()->view()->page()->currentFrame()->setScrollPosition(test); + currentTab()->view()->page()->currentFrame()->setScrollPosition(previous_position); } } -- cgit v1.2.1