From c5bad8ec49fee2bdea7469a2b5ccc6287a42d728 Mon Sep 17 00:00:00 2001 From: rating89us <45968869+rating89us@users.noreply.github.com> Date: Mon, 7 Jun 2021 18:29:30 +0200 Subject: [PATCH] SettingsLog: fix text color bug on theme switch; new warning and green text colors --- pages/settings/SettingsLog.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 55a6d6e8..2cbdc63e 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -132,6 +132,18 @@ Rectangle { font.pixelSize: 18 font.family: MoneroComponents.Style.fontRegular.name text: qsTr("Daemon log") + translationManager.emptyString + themeTransition: false + onColorChanged: { + var flickableContentYBefore = flickable.contentY + var daemonLogText = consoleArea.text + consoleArea.clear(); + if (MoneroComponents.Style.blackTheme) { + consoleArea.append(daemonLogText.replace(/#000000/g, '#ffffff').replace(/#008000/g, '#00ff00')); + } else { + consoleArea.append(daemonLogText.replace(/#ffffff/g, '#000000').replace(/#00ff00/g, '#008000')); + } + flickable.contentY = flickableContentYBefore + } } Item { @@ -164,7 +176,7 @@ Rectangle { wrapMode: TextEdit.Wrap readOnly: true function logCommand(msg){ - msg = log_color(msg, "lime"); + msg = log_color(msg, MoneroComponents.Style.blackTheme ? "lime" : "green"); consoleArea.append(msg); } function logMessage(msg){ @@ -173,7 +185,7 @@ Rectangle { if(msg.toLowerCase().indexOf('error') >= 0){ color = MoneroComponents.Style.errorColor; } else if (msg.toLowerCase().indexOf('warning') >= 0){ - color = MoneroComponents.Style.warningColor; + color = "#fa6800" } // format multi-lines