From ac1957ff681a946687752e8fc60b318d4c81c120 Mon Sep 17 00:00:00 2001 From: TranRed Date: Mon, 22 Apr 2019 18:32:58 +0200 Subject: [PATCH] Quick fix for highlighting in light themes set defaults for highlighting colors. Only use "hidden setting" when populated. --- src/singletons/Settings.hpp | 2 +- src/singletons/Theme.cpp | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 9e3df9dcf..17ff94637 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -144,7 +144,7 @@ public: "/highlighting/whisperHighlight/enableSound", false}; BoolSetting enableWhisperHighlightTaskbar = { "/highlighting/whisperHighlight/enableTaskbarFlashing", false}; - QStringSetting highlightColor = {"/highlighting/color", "#4B282C"}; + QStringSetting highlightColor = {"/highlighting/color", ""}; BoolSetting longAlerts = {"/highlighting/alerts", false}; diff --git a/src/singletons/Theme.cpp b/src/singletons/Theme.cpp index 70d70776c..1c1411ec2 100644 --- a/src/singletons/Theme.cpp +++ b/src/singletons/Theme.cpp @@ -38,6 +38,10 @@ void Theme::actuallyUpdate(double hue, double multiplier) this->splits.resizeHandle = QColor(0, 148, 255, 0xff); this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x50); + + // Highlighted Messages: theme support quick-fix + this->messages.backgrounds.highlighted = + QColor("#BD8489"); } else { @@ -46,6 +50,11 @@ void Theme::actuallyUpdate(double hue, double multiplier) this->splits.resizeHandle = QColor(0, 148, 255, 0x70); this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x20); + + // Highlighted Messages: theme support quick-fix + this->messages.backgrounds.highlighted = + QColor("#4B282C"); + } this->splits.header.background = getColor(0, sat, flat ? 1 : 0.9); @@ -74,8 +83,13 @@ void Theme::actuallyUpdate(double hue, double multiplier) this->splits.dropPreviewBorder = QColor(0, 148, 255, 0xff); // Highlighted Messages - this->messages.backgrounds.highlighted = - QColor(getSettings()->highlightColor); + // hidden setting from PR #744 - if set it will overwrite theme color (for now!) + //TODO: implement full theme support + if (getSettings()->highlightColor != "") { + this->messages.backgrounds.highlighted = + QColor(getSettings()->highlightColor); + } + } void Theme::normalizeColor(QColor &color)