summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-03-14 12:47:08 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-03-15 10:09:40 +0100
commitcb3c582272a729bd49f072f8ffe67beecc31df35 (patch)
tree6e4b9a58c1aabad5c1dd7ee109fb4ce1101d49f4 /src/mainwindow.cpp
parentrekonq 0.4.52 (diff)
downloadrekonq-cb3c582272a729bd49f072f8ffe67beecc31df35.tar.xz
Implement the highlight all feature for the find bar (enabled by default)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4b48157b..a459cc78 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -797,6 +797,8 @@ void MainWindow::findNext()
return;
}
+ highlightAll();
+
QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument;
if (m_findBar->matchCase())
options |= QWebPage::FindCaseSensitively;
@@ -826,6 +828,24 @@ void MainWindow::findPrevious()
m_findBar->notifyMatch(found);
}
+void MainWindow::highlightAll()
+{
+ if (!currentTab())
+ return;
+
+ QWebPage::FindFlags options = QWebPage::HighlightAllOccurrences;
+
+ currentTab()->view()->findText("", options); //Clear an existing highlight
+
+ if(m_findBar->highlightAllState() && !m_findBar->isHidden())
+ {
+ if (m_findBar->matchCase())
+ options |= QWebPage::FindCaseSensitively;
+
+ currentTab()->view()->findText(m_lastSearch, options);
+ }
+}
+
void MainWindow::zoomIn()
{