From 139c3bca0373aa89384059070812a85821ea1a19 Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sat, 25 Jul 2009 19:01:56 +0200 Subject: Remove notification for search text Notify matching by changing the background color of the text field --- src/findbar.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/findbar.cpp') diff --git a/src/findbar.cpp b/src/findbar.cpp index 3efe470b..b2dc5344 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -29,12 +29,14 @@ #include #include #include +#include // Qt Includes #include #include #include #include +#include #include #include @@ -139,6 +141,28 @@ void FindBar::keyPressEvent(QKeyEvent* event) emit searchString(m_lineEdit->text()); return; } + QWidget::keyPressEvent(event); } +void FindBar::notifyMatch(bool match) +{ + QPalette p = m_lineEdit->palette(); + + if (m_lineEdit->text().isEmpty()) + { + p.setColor(QPalette::Base, QColor(KApplication::palette().color(QPalette::Active, QPalette::Base))); + } + else if (match) + { + p.setColor(QPalette::Base, QColor(186, 249, 206)); + } + else + { + p.setColor(QPalette::Base, QColor(247, 230, 230)); + } + + m_lineEdit->setPalette(p); +} + + -- cgit v1.2.1