Commit 639a4248 authored by Francesco Cecconi's avatar Francesco Cecconi
Browse files

Use 'KColorScheme::PositiveBackground' for a positive search result

Set '_searchEdit' field background to 'KColorScheme::PositiveBackground'
when a search has a positive result.

BUG: 167442
REVIEW: 105777
FIXED-IN: 4.10.0
parent 3b5db6cf
......@@ -180,8 +180,15 @@ void IncrementalSearchBar::setFoundMatch(bool match)
.arg(backgroundBrush.brush(_searchEdit).color().name());
_searchEdit->setStyleSheet(matchStyleSheet);
} else if (_searchEdit->text().isEmpty()) {
clearLineEdit();
} else {
_searchEdit->setStyleSheet(QString());
KStatefulBrush backgroundBrush(KColorScheme::View, KColorScheme::PositiveBackground);
QString matchStyleSheet = QString("QLineEdit{ background-color:%1 }")
.arg(backgroundBrush.brush(_searchEdit).color().name());
_searchEdit->setStyleSheet(matchStyleSheet);
}
}
......
......@@ -123,9 +123,11 @@ signals:
protected:
virtual bool eventFilter(QObject* watched , QEvent* event);
public slots:
void clearLineEdit();
private slots:
void notifySearchChanged();
void clearLineEdit();
private:
bool _foundMatch;
......
......@@ -1030,6 +1030,7 @@ void SessionController::enableSearchBar(bool showSearchBar)
if (showSearchBar) {
connect(_searchBar, SIGNAL(searchChanged(QString)), this,
SLOT(searchTextChanged(QString)));
_searchBar->clearLineEdit();
} else {
disconnect(_searchBar, SIGNAL(searchChanged(QString)), this,
SLOT(searchTextChanged(QString)));
......@@ -1113,6 +1114,9 @@ void SessionController::beginSearch(const QString& text , int direction)
task->addScreenWindow(_session , _view->screenWindow());
task->execute();
}
else if (text.isEmpty()) {
searchCompleted(false);
}
_view->processFilters();
}
......
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