From 9519c9830c7c11835179cd3ef8dd7277a4e9af37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Tue, 4 Jun 2024 16:41:50 +0200 Subject: [PATCH] Improve text coloring in log --- batchprocessing.cpp | 5 +++-- batchprocessing.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/batchprocessing.cpp b/batchprocessing.cpp index 5dfbecc..bce8507 100644 --- a/batchprocessing.cpp +++ b/batchprocessing.cpp @@ -90,6 +90,8 @@ BatchProcessing::BatchProcessing(QWidget *parent) : QDialog(parent) connect(_ui->browseButton, &QPushButton::released, this, &BatchProcessing::browse); connect(_ui->openScriptsButton, &QPushButton::released, this, &BatchProcessing::openScriptDir); + _textColor = _ui->log->textColor(); + QSettings settings; _ui->outputPath->setText(settings.value("batchprocessing/outputpath", QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first()).toString()); } @@ -214,8 +216,7 @@ void BatchProcessing::scriptFinished() void BatchProcessing::newMessage(const QString &message, bool error) { - QColor color = _ui->log->textColor(); if(error)_ui->log->setTextColor(Qt::red); + else _ui->log->setTextColor(_textColor); _ui->log->append(message); - if(error)_ui->log->setTextColor(color); } diff --git a/batchprocessing.h b/batchprocessing.h index 859ea63..3e938d7 100644 --- a/batchprocessing.h +++ b/batchprocessing.h @@ -13,6 +13,7 @@ class BatchProcessing : public QDialog QString _scriptBasePath; QFileSystemWatcher _fileWatcher; Script::ScriptEngineThread *_engineThread = nullptr; + QColor _textColor; private slots: void scanScriptDir(); public: