summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-22 14:04:30 +0200
committerMontel Laurent <[email protected]>2017-08-22 14:04:30 +0200
commitdb71b378430db25fca4210f0a48eab593c1aeba5 (patch)
tree75dd76b2ef06cd4bddf66b46d38ca58afb26bb0f
parent286ec31bb686bc7eec743a180a52978063c8d312 (diff)
Really show when we use a filter in searchlineedit
-rw-r--r--messagelist/src/core/widgets/searchlinestatus.cpp7
-rw-r--r--messagelist/src/core/widgets/searchlinestatus.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/messagelist/src/core/widgets/searchlinestatus.cpp b/messagelist/src/core/widgets/searchlinestatus.cpp
index fb7e8be..d14b69d 100644
--- a/messagelist/src/core/widgets/searchlinestatus.cpp
+++ b/messagelist/src/core/widgets/searchlinestatus.cpp
@@ -29,6 +29,7 @@
#include <QCompleter>
#include <QContextMenuEvent>
#include <QStringListModel>
+#include <KColorScheme>
static const char qLineEditclearButtonActionNameC[] = "_q_qlineeditclearaction";
#define MAX_COMPLETION_ITEMS 20
@@ -163,6 +164,12 @@ void SearchLineStatus::createFilterAction(const QIcon &icon, const QString &text
void SearchLineStatus::updateFilterActionIcon()
{
mFiltersAction->setIcon(mHasFilter ? mWithFilter : mWithoutFilter);
+ if (mColorName.isEmpty()) {
+ const KColorScheme::BackgroundRole bgColorScheme(KColorScheme::PositiveBackground);
+ KStatefulBrush bgBrush(KColorScheme::View, bgColorScheme);
+ mColorName = bgBrush.brush(this).color().name();
+ }
+ setStyleSheet(mHasFilter ? QStringLiteral("QLineEdit{ background-color:%1 }").arg(mColorName) : QString());
}
void SearchLineStatus::clearFilterButtonClicked()
diff --git a/messagelist/src/core/widgets/searchlinestatus.h b/messagelist/src/core/widgets/searchlinestatus.h
index 0b83c5e..493c657 100644
--- a/messagelist/src/core/widgets/searchlinestatus.h
+++ b/messagelist/src/core/widgets/searchlinestatus.h
@@ -86,6 +86,7 @@ private:
QAction *mSearchAgainstBccAction;
QStringListModel *mCompleterListModel;
QStringList mListCompetion;
+ QString mColorName;
bool mContainsOutboundMessages;
};