summaryrefslogtreecommitdiffstats
path: root/gui/ConsoleWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ConsoleWindow.cpp')
-rw-r--r--gui/ConsoleWindow.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp
index 24afbc0a..e640d261 100644
--- a/gui/ConsoleWindow.cpp
+++ b/gui/ConsoleWindow.cpp
@@ -58,10 +58,17 @@ ConsoleWindow::~ConsoleWindow()
void ConsoleWindow::writeColor(QString text, const char *color)
{
// append a paragraph
- if (color != nullptr)
- ui->text->appendHtml(QString("<font color=\"%1\">%2</font>").arg(color).arg(text));
- else
- ui->text->appendPlainText(text);
+ QString newtext;
+ newtext += "<span style=\"";
+ {
+ if(color)
+ newtext += QString("color:") + color + ";";
+ newtext += "font-family: monospace;";
+ }
+ newtext += "\">";
+ newtext += text.toHtmlEscaped();
+ newtext += "</span>";
+ ui->text->appendHtml(newtext);
}
void ConsoleWindow::write(QString data, MessageLevel::Enum mode)