forked from qt-creator/qt-creator
ProjectExplorer: Use themed colors in CustomParserConfigDialog
Otherwise the text is unreadable in dark themes. Change-Id: Ib5db499f51155b17dc0a3b142dbc189c31cf4df2 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "customparserconfigdialog.h"
|
||||
#include "ui_customparserconfigdialog.h"
|
||||
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
@@ -270,13 +272,17 @@ bool CustomParserConfigDialog::checkPattern(QLineEdit *pattern, const QString &o
|
||||
rx.setPattern(pattern->text());
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Text, rx.isValid() ? Qt::black : Qt::red);
|
||||
palette.setColor(QPalette::Text,
|
||||
Utils::creatorTheme()->color(rx.isValid() ? Utils::Theme::TextColorNormal
|
||||
: Utils::Theme::TextColorError));
|
||||
pattern->setPalette(palette);
|
||||
pattern->setToolTip(rx.isValid() ? QString() : rx.errorString());
|
||||
|
||||
*match = rx.match(outputText);
|
||||
if (rx.pattern().isEmpty() || !rx.isValid() || !match->hasMatch()) {
|
||||
*errorMessage = QLatin1String("<font color=\"red\">") + tr("Not applicable:") + QLatin1Char(' ');
|
||||
*errorMessage = QString::fromLatin1("<font color=\"%1\">%2 ").arg(
|
||||
Utils::creatorTheme()->color(Utils::Theme::TextColorError).name(),
|
||||
tr("Not applicable:"));
|
||||
if (rx.pattern().isEmpty())
|
||||
*errorMessage += tr("Pattern is empty.");
|
||||
else if (!rx.isValid())
|
||||
|
Reference in New Issue
Block a user