diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2018-11-23 12:33:42 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-11-24 16:01:55 +0000 |
commit | 58736127677d3941ec2ec020d6c99012c5d9b309 (patch) | |
tree | ece46c80c71a63c47bad511dadcde35fa2ecf86c /src/libs/utils/outputformatter.cpp | |
parent | 28352173e4f11d2d790305055f4993daefe3b3a1 (diff) |
VCS: Unbold messages and errors in output pane
Change-Id: Id154d75c07cf95b9ceaad3ee26fcac08e66b3200
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/libs/utils/outputformatter.cpp')
-rw-r--r-- | src/libs/utils/outputformatter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libs/utils/outputformatter.cpp b/src/libs/utils/outputformatter.cpp index 095ca24ac3..bc28776b33 100644 --- a/src/libs/utils/outputformatter.cpp +++ b/src/libs/utils/outputformatter.cpp @@ -42,6 +42,7 @@ public: QTextCursor cursor; AnsiEscapeCodeHandler escapeCodeHandler; OutputFormat lastFormat = NumberOfFormats; + bool boldFontEnabled = true; }; } // namespace Internal @@ -123,11 +124,9 @@ void OutputFormatter::initFormats() Theme *theme = creatorTheme(); // NormalMessageFormat - d->formats[NormalMessageFormat].setFontWeight(QFont::Bold); d->formats[NormalMessageFormat].setForeground(theme->color(Theme::OutputPanes_NormalMessageTextColor)); // ErrorMessageFormat - d->formats[ErrorMessageFormat].setFontWeight(QFont::Bold); d->formats[ErrorMessageFormat].setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor)); // LogMessageFormat @@ -142,6 +141,8 @@ void OutputFormatter::initFormats() d->formats[StdErrFormatSameLine] = d->formats[StdErrFormat]; d->formats[DebugFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor)); + + setBoldFontEnabled(d->boldFontEnabled); } void OutputFormatter::handleLink(const QString &href) @@ -149,6 +150,14 @@ void OutputFormatter::handleLink(const QString &href) Q_UNUSED(href); } +void OutputFormatter::setBoldFontEnabled(bool enabled) +{ + d->boldFontEnabled = enabled; + const QFont::Weight fontWeight = enabled ? QFont::Bold : QFont::Normal; + d->formats[NormalMessageFormat].setFontWeight(fontWeight); + d->formats[ErrorMessageFormat].setFontWeight(fontWeight); +} + void OutputFormatter::flush() { d->escapeCodeHandler.endFormatScope(); |