Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit db71b378 authored by Laurent Montel's avatar Laurent Montel 😁

Really show when we use a filter in searchlineedit

parent 286ec31b
......@@ -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()
......
......@@ -86,6 +86,7 @@ private:
QAction *mSearchAgainstBccAction;
QStringListModel *mCompleterListModel;
QStringList mListCompetion;
QString mColorName;
bool mContainsOutboundMessages;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment