forked from qt-creator/qt-creator
Utils: Use Theme default "ok" and "error" colors for FancyLineEdit
...and remove the redundant setter calls elsewhere. Change-Id: Iec71fe1bff7f8c9dd72bf3c3e643a4ed01e4dc80 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -134,7 +134,7 @@ public:
|
|||||||
QString m_lastFilterText;
|
QString m_lastFilterText;
|
||||||
|
|
||||||
QColor m_okTextColor;
|
QColor m_okTextColor;
|
||||||
QColor m_errorTextColor = Qt::red;
|
QColor m_errorTextColor;
|
||||||
QString m_errorMessage;
|
QString m_errorMessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,7 +143,8 @@ FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) :
|
|||||||
m_lineEdit(parent),
|
m_lineEdit(parent),
|
||||||
m_completionShortcut(completionShortcut()->key(), parent)
|
m_completionShortcut(completionShortcut()->key(), parent)
|
||||||
{
|
{
|
||||||
m_okTextColor = parent->palette().color(QPalette::Active, QPalette::Text);
|
m_okTextColor = creatorTheme()->color(Theme::TextColorNormal);
|
||||||
|
m_errorTextColor = creatorTheme()->color(Theme::TextColorError);
|
||||||
|
|
||||||
m_completionShortcut.setContext(Qt::WidgetShortcut);
|
m_completionShortcut.setContext(Qt::WidgetShortcut);
|
||||||
connect(completionShortcut(), &CompletionShortcut::keyChanged,
|
connect(completionShortcut(), &CompletionShortcut::keyChanged,
|
||||||
|
|||||||
@@ -234,7 +234,6 @@ PathChooser::PathChooser(QWidget *parent) :
|
|||||||
connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { emit pathChanged(d->m_lineEdit->text()); });
|
connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { emit pathChanged(d->m_lineEdit->text()); });
|
||||||
|
|
||||||
d->m_lineEdit->setMinimumWidth(120);
|
d->m_lineEdit->setMinimumWidth(120);
|
||||||
d->m_lineEdit->setErrorColor(creatorTheme()->color(Theme::TextColorError));
|
|
||||||
d->m_hLayout->addWidget(d->m_lineEdit);
|
d->m_hLayout->addWidget(d->m_lineEdit);
|
||||||
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,6 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
|
|||||||
m_ui.findEdit->setButtonVisible(Utils::FancyLineEdit::Left, true);
|
m_ui.findEdit->setButtonVisible(Utils::FancyLineEdit::Left, true);
|
||||||
m_ui.findEdit->setFiltering(true);
|
m_ui.findEdit->setFiltering(true);
|
||||||
m_ui.findEdit->setPlaceholderText(QString());
|
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->button(Utils::FancyLineEdit::Left)->setFocusPolicy(Qt::TabFocus);
|
||||||
m_ui.findEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
m_ui.findEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
||||||
return m_lastResult != IFindSupport::NotFound;
|
return m_lastResult != IFindSupport::NotFound;
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
|
|||||||
auto completer = new QCompleter(this);
|
auto completer = new QCompleter(this);
|
||||||
completer->setModel(m_queryModel);
|
completer->setModel(m_queryModel);
|
||||||
m_ui->queryLineEdit->setSpecialCompleter(completer);
|
m_ui->queryLineEdit->setSpecialCompleter(completer);
|
||||||
m_ui->queryLineEdit->setOkColor(Utils::creatorTheme()->color(Utils::Theme::TextColorNormal));
|
|
||||||
m_ui->queryLineEdit->setErrorColor(Utils::creatorTheme()->color(Utils::Theme::TextColorError));
|
|
||||||
m_ui->queryLineEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
m_ui->queryLineEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
||||||
return m_model->state() != GerritModel::Error;
|
return m_model->state() != GerritModel::Error;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user