aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Tillmanns <marcus.tillmanns@qt.io>2024-05-07 07:51:08 +0200
committerMarcus Tillmanns <marcus.tillmanns@qt.io>2024-05-07 11:15:04 +0000
commitdced7ce9131400d48fcea5beb1c5a932dc4bcdb6 (patch)
tree437dd134870f927ddf90c98b2025ca899965981d
parent770f1b0376db49b9ea5aad906dd6165ab71d9152 (diff)
CMake: Use theme colors for text prefix
Also uses new Utils::ansiColoredText() function. Change-Id: I43e59f78eb47903fc273244a9cd4e9da9b68839f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprocess.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
index c0a41b817d..9b4f5cd2ec 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
@@ -177,16 +177,9 @@ void CMakeProcess::stop()
QString addCMakePrefix(const QString &str)
{
- auto qColorToAnsiCode = [] (const QColor &color) {
- return QString::fromLatin1("\033[38;2;%1;%2;%3m")
- .arg(color.red()).arg(color.green()).arg(color.blue());
- };
- static const QColor bgColor = creatorTheme()->color(Theme::BackgroundColorNormal);
- static const QColor fgColor = creatorTheme()->color(Theme::TextColorNormal);
- static const QColor grey = StyleHelper::mergedColors(fgColor, bgColor, 80);
- static const QString prefixString = qColorToAnsiCode(grey) + Constants::OUTPUT_PREFIX
- + qColorToAnsiCode(fgColor);
- return QString("%1%2").arg(prefixString, str);
+ static const QString prefix
+ = ansiColoredText(Constants::OUTPUT_PREFIX, creatorTheme()->color(Theme::Token_Text_Muted));
+ return prefix + str;
}
QStringList addCMakePrefix(const QStringList &list)