|
@@ -27,6 +27,9 @@ OBSLogViewer::OBSLogViewer(QWidget *parent) : QDialog(parent)
|
|
textArea = new QPlainTextEdit();
|
|
textArea = new QPlainTextEdit();
|
|
textArea->setReadOnly(true);
|
|
textArea->setReadOnly(true);
|
|
textArea->setFont(fixedFont);
|
|
textArea->setFont(fixedFont);
|
|
|
|
+ // Fix display of tabs & multiple spaces
|
|
|
|
+ textArea->document()->setDefaultStyleSheet(
|
|
|
|
+ "font { white-space: pre; }");
|
|
|
|
|
|
QHBoxLayout *buttonLayout = new QHBoxLayout();
|
|
QHBoxLayout *buttonLayout = new QHBoxLayout();
|
|
QPushButton *clearButton = new QPushButton(QTStr("Clear"));
|
|
QPushButton *clearButton = new QPushButton(QTStr("Clear"));
|
|
@@ -112,7 +115,7 @@ void OBSLogViewer::InitLog()
|
|
cursor.beginEditBlock();
|
|
cursor.beginEditBlock();
|
|
while (!in.atEnd()) {
|
|
while (!in.atEnd()) {
|
|
QString line = in.readLine();
|
|
QString line = in.readLine();
|
|
- cursor.insertHtml(line);
|
|
|
|
|
|
+ cursor.insertText(line);
|
|
cursor.insertBlock();
|
|
cursor.insertBlock();
|
|
}
|
|
}
|
|
cursor.endEditBlock();
|
|
cursor.endEditBlock();
|
|
@@ -136,6 +139,9 @@ void OBSLogViewer::AddLine(int type, const QString &str)
|
|
case LOG_ERROR:
|
|
case LOG_ERROR:
|
|
msg = QString("<font color=\"#c00000\">%1</font>").arg(msg);
|
|
msg = QString("<font color=\"#c00000\">%1</font>").arg(msg);
|
|
break;
|
|
break;
|
|
|
|
+ default:
|
|
|
|
+ msg = QString("<font>%1</font>").arg(msg);
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
|
|
QScrollBar *scroll = textArea->verticalScrollBar();
|
|
QScrollBar *scroll = textArea->verticalScrollBar();
|