diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-03-14 12:47:08 +0100 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-03-14 12:47:08 +0100 |
commit | 26eb96169454a41d0c3306b6329e8751882a2d1e (patch) | |
tree | 7f681e73ee52546316a82fa358284d7f880ae396 /src/mainwindow.cpp | |
parent | Updating forgotten files (diff) | |
download | rekonq-26eb96169454a41d0c3306b6329e8751882a2d1e.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.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 60784af0..e90a5903 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -794,6 +794,8 @@ void MainWindow::findNext() return; } + highlightAll(); + QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) options |= QWebPage::FindCaseSensitively; @@ -823,6 +825,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() { |