diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-03-14 12:47:08 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-03-15 10:09:40 +0100 |
commit | cb3c582272a729bd49f072f8ffe67beecc31df35 (patch) | |
tree | 6e4b9a58c1aabad5c1dd7ee109fb4ce1101d49f4 /src/findbar.cpp | |
parent | rekonq 0.4.52 (diff) | |
download | rekonq-cb3c582272a729bd49f072f8ffe67beecc31df35.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.cpp | 26 |
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 |