diff options
-rw-r--r-- | gui/ConsoleWindow.cpp | 15 | ||||
-rw-r--r-- | gui/ConsoleWindow.ui | 5 |
2 files changed, 11 insertions, 9 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) diff --git a/gui/ConsoleWindow.ui b/gui/ConsoleWindow.ui index 62cc89ac..c2307ecc 100644 --- a/gui/ConsoleWindow.ui +++ b/gui/ConsoleWindow.ui @@ -17,11 +17,6 @@ <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QPlainTextEdit" name="text"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> <property name="undoRedoEnabled"> <bool>false</bool> </property> |