Commit 0aad5fac authored by Tobias Hunger's avatar Tobias Hunger

FindToolBar: Update to FancyLineEdit changes

Change-Id: I2a1b0440e0cbf511f7e73057bb9fe75e3a01a695
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent b0bb2d34
......@@ -111,7 +111,12 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_ui.findEdit->setButtonVisible(Utils::FancyLineEdit::Left, true);
m_ui.findEdit->setFiltering(true);
m_ui.findEdit->setPlaceholderText(QString());
m_ui.findEdit->setOkColor(Utils::creatorTheme()->color(Utils::Theme::TextColorNormal));
m_ui.findEdit->setErrorColor(Utils::creatorTheme()->color(Utils::Theme::TextColorError));
m_ui.findEdit->button(Utils::FancyLineEdit::Left)->setFocusPolicy(Qt::TabFocus);
m_ui.findEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
return m_lastResult != IFindSupport::NotFound;
});
m_ui.replaceEdit->setPlaceholderText(QString());
connect(m_ui.findEdit, &Utils::FancyLineEdit::textChanged,
......@@ -789,9 +794,8 @@ void FindToolBar::acceptCandidateAndMoveToolBar()
void FindToolBar::indicateSearchState(IFindSupport::Result searchState)
{
const Utils::Theme::Color colorRole = searchState == IFindSupport::NotFound
? Utils::Theme::TextColorError : Utils::Theme::TextColorNormal;
m_ui.findEdit->setTextColor(m_ui.findEdit, Utils::creatorTheme()->color(colorRole));
m_lastResult = searchState;
m_ui.findEdit->validate();
}
void FindToolBar::openFind(bool focus)
......
......@@ -194,6 +194,7 @@ private:
QTimer m_findIncrementalTimer;
QTimer m_findStepTimer;
IFindSupport::Result m_lastResult;
bool m_useFakeVim;
bool m_eventFiltersInstalled;
};
......
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