forked from qt-creator/qt-creator
VCS: Unbold messages and errors in output pane
Change-Id: Id154d75c07cf95b9ceaad3ee26fcac08e66b3200 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
28352173e4
commit
5873612767
@@ -42,6 +42,7 @@ public:
|
|||||||
QTextCursor cursor;
|
QTextCursor cursor;
|
||||||
AnsiEscapeCodeHandler escapeCodeHandler;
|
AnsiEscapeCodeHandler escapeCodeHandler;
|
||||||
OutputFormat lastFormat = NumberOfFormats;
|
OutputFormat lastFormat = NumberOfFormats;
|
||||||
|
bool boldFontEnabled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
@@ -123,11 +124,9 @@ void OutputFormatter::initFormats()
|
|||||||
Theme *theme = creatorTheme();
|
Theme *theme = creatorTheme();
|
||||||
|
|
||||||
// NormalMessageFormat
|
// NormalMessageFormat
|
||||||
d->formats[NormalMessageFormat].setFontWeight(QFont::Bold);
|
|
||||||
d->formats[NormalMessageFormat].setForeground(theme->color(Theme::OutputPanes_NormalMessageTextColor));
|
d->formats[NormalMessageFormat].setForeground(theme->color(Theme::OutputPanes_NormalMessageTextColor));
|
||||||
|
|
||||||
// ErrorMessageFormat
|
// ErrorMessageFormat
|
||||||
d->formats[ErrorMessageFormat].setFontWeight(QFont::Bold);
|
|
||||||
d->formats[ErrorMessageFormat].setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor));
|
d->formats[ErrorMessageFormat].setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor));
|
||||||
|
|
||||||
// LogMessageFormat
|
// LogMessageFormat
|
||||||
@@ -142,6 +141,8 @@ void OutputFormatter::initFormats()
|
|||||||
d->formats[StdErrFormatSameLine] = d->formats[StdErrFormat];
|
d->formats[StdErrFormatSameLine] = d->formats[StdErrFormat];
|
||||||
|
|
||||||
d->formats[DebugFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor));
|
d->formats[DebugFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor));
|
||||||
|
|
||||||
|
setBoldFontEnabled(d->boldFontEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputFormatter::handleLink(const QString &href)
|
void OutputFormatter::handleLink(const QString &href)
|
||||||
@@ -149,6 +150,14 @@ void OutputFormatter::handleLink(const QString &href)
|
|||||||
Q_UNUSED(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()
|
void OutputFormatter::flush()
|
||||||
{
|
{
|
||||||
d->escapeCodeHandler.endFormatScope();
|
d->escapeCodeHandler.endFormatScope();
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public:
|
|||||||
virtual void handleLink(const QString &href);
|
virtual void handleLink(const QString &href);
|
||||||
virtual QList<QWidget *> toolbarWidgets() const { return {}; }
|
virtual QList<QWidget *> toolbarWidgets() const { return {}; }
|
||||||
virtual void clear() {}
|
virtual void clear() {}
|
||||||
|
void setBoldFontEnabled(bool enabled);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initFormats();
|
void initFormats();
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ OutputWindowPlainTextEdit::OutputWindowPlainTextEdit(QWidget *parent) :
|
|||||||
setUndoRedoEnabled(false);
|
setUndoRedoEnabled(false);
|
||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
m_formatter = new OutputFormatter;
|
m_formatter = new OutputFormatter;
|
||||||
|
m_formatter->setBoldFontEnabled(false);
|
||||||
m_formatter->setPlainTextEdit(this);
|
m_formatter->setPlainTextEdit(this);
|
||||||
auto agg = new Aggregation::Aggregate;
|
auto agg = new Aggregation::Aggregate;
|
||||||
agg->add(this);
|
agg->add(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user