summaryrefslogtreecommitdiff
path: root/src/findbar.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-03-14 12:47:08 +0100
committerYoann Laissus <yoann.laissus@gmail.com>2010-03-14 12:47:08 +0100
commit26eb96169454a41d0c3306b6329e8751882a2d1e (patch)
tree7f681e73ee52546316a82fa358284d7f880ae396 /src/findbar.cpp
parentUpdating forgotten files (diff)
downloadrekonq-26eb96169454a41d0c3306b6329e8751882a2d1e.tar.xz
Implement the highlight all feature for the find bar (enabled by default)
Diffstat (limited to 'src/findbar.cpp')
-rw-r--r--src/findbar.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/findbar.cpp b/src/findbar.cpp
index 4c780aca..94def263 100644
--- a/src/findbar.cpp
+++ b/src/findbar.cpp
@@ -52,9 +52,13 @@
FindBar::FindBar(QWidget *parent)
: QWidget(parent)
, m_lineEdit(new KLineEdit(this))
- , m_matchCase(new QCheckBox(i18n("&Match case"), this))
, m_hideTimer(new QTimer(this))
-{
+ , m_matchCase(new QCheckBox(i18n("&Match case"), this))
+ , m_highlightAll(new QCheckBox(i18n("&Highlight All"), this))
+{
+ // mainwindow pointer
+ MainWindow *window = qobject_cast<MainWindow *>(parent);
+
QHBoxLayout *layout = new QHBoxLayout;
// cosmetic
@@ -65,6 +69,7 @@ FindBar::FindBar(QWidget *parent)
hideButton->setAutoRaise(true);
hideButton->setIcon(KIcon("dialog-close"));
connect(hideButton, SIGNAL(clicked()), this, SLOT(hide()));
+ connect(hideButton, SIGNAL(clicked()), window, SLOT(highlightAll()));
layout->addWidget(hideButton);
layout->setAlignment(hideButton, Qt::AlignLeft | Qt::AlignTop);
@@ -75,9 +80,6 @@ FindBar::FindBar(QWidget *parent)
QLabel *label = new QLabel(i18n("Find:"));
layout->addWidget(label);
- // mainwindow pointer
- MainWindow *window = qobject_cast<MainWindow *>(parent);
-
// lineEdit, focusProxy
setFocusProxy(m_lineEdit);
m_lineEdit->setMaximumWidth(250);
@@ -92,13 +94,19 @@ FindBar::FindBar(QWidget *parent)
connect(findPrev, SIGNAL(clicked()), window, SLOT(findPrevious()));
layout->addWidget(findNext);
layout->addWidget(findPrev);
-
+
// Case sensitivity. Deliberately set so this is off by default.
m_matchCase->setCheckState(Qt::Unchecked);
m_matchCase->setTristate(false);
connect(m_matchCase, SIGNAL(toggled(bool)), window, SLOT(matchCaseUpdate()));
layout->addWidget(m_matchCase);
+ // Hightlight All. On by default
+ m_highlightAll->setCheckState(Qt::Checked);
+ m_highlightAll->setTristate(false);
+ connect(m_highlightAll, SIGNAL(toggled(bool)), window, SLOT(highlightAll()));
+ layout->addWidget(m_highlightAll);
+
// stretching widget on the left
layout->addStretch();
@@ -126,6 +134,12 @@ bool FindBar::matchCase() const
}
+bool FindBar::highlightAllState() const
+{
+ return m_highlightAll->isChecked();
+}
+
+
void FindBar::show()
{
// show findbar if not visible