Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
wyzdwdz committed Apr 17, 2024
1 parent b311aa1 commit bc81e97
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/qt/log_highlighter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@

#include "log_highlighter.h"

#include <QGuiApplication>
#include <QPalette>
#include <QStyleHints>

LogHighlighter::LogHighlighter(QTextDocument* parent)
: QSyntaxHighlighter(parent) {
warn_format_.setForeground(Qt::blue);
error_format_.setForeground(Qt::red);
auto hints = QGuiApplication::styleHints();
auto scheme = hints->colorScheme();
if(scheme == Qt::ColorScheme::Dark) {
warn_format_.setForeground(Qt::blue);
error_format_.setForeground(Qt::yellow);
} else {
warn_format_.setForeground(Qt::blue);
error_format_.setForeground(Qt::red);
}

info_expression_ = QRegularExpression("^\\[INFO\\].*$");
warn_expression_ = QRegularExpression("^\\[WARN\\].*$");
Expand Down
2 changes: 0 additions & 2 deletions src/qt/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
#endif

int main(int argc, char** argv) {
qputenv("QT_QPA_PLATFORM", "windows:darkmode=0");

QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);

Expand Down

0 comments on commit bc81e97

Please sign in to comment.