From edd9d620b02fdb853db382a20c3fd34f7250ad3a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 22 Jan 2020 18:20:10 +0100 Subject: [PATCH] ProjectExplorer: Use themed colors in CustomParserConfigDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise the text is unreadable in dark themes. Change-Id: Ib5db499f51155b17dc0a3b142dbc189c31cf4df2 Reviewed-by: André Hartmann --- .../projectexplorer/customparserconfigdialog.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/customparserconfigdialog.cpp b/src/plugins/projectexplorer/customparserconfigdialog.cpp index 061d1814ed4..7e6bb28ee26 100644 --- a/src/plugins/projectexplorer/customparserconfigdialog.cpp +++ b/src/plugins/projectexplorer/customparserconfigdialog.cpp @@ -26,6 +26,8 @@ #include "customparserconfigdialog.h" #include "ui_customparserconfigdialog.h" +#include + #include #include #include @@ -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("") + tr("Not applicable:") + QLatin1Char(' '); + *errorMessage = QString::fromLatin1("%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())