summary refs log tree commit diff
path: root/src/MainWindow.cpp
diff options
context:
space:
mode:
authorredsky17 <joedonofry@gmail.com>2019-01-20 04:43:48 +0000
committerredsky17 <joedonofry@gmail.com>2019-01-20 04:43:48 +0000
commit237c7ad114b7c3d6960fdaf712b600e715eff082 (patch)
tree77f9f2f3f8eb6256a538e653bd1ed2b615fd8625 /src/MainWindow.cpp
parentUpdate user id color generation (diff)
downloadnheko-237c7ad114b7c3d6960fdaf712b600e715eff082.tar.xz
Author Color Fixes
Author color is now cached so that it will not be re-calculated
each time a new message is posted.  This cache gets cleared when
the theme is changed.

Additionally, the author color is now automatically refreshed
when the theme is changed, fixing the issue where you had to
change rooms before the colors would switch.
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r--src/MainWindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 55dbba34..450eb71a 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -112,7 +112,11 @@ MainWindow::MainWindow(QWidget *parent)
 
         connect(
           userSettingsPage_, SIGNAL(trayOptionChanged(bool)), trayIcon_, SLOT(setVisible(bool)));
-
+        connect(userSettingsPage_, &UserSettingsPage::themeChanged, this, [this]() {
+                utils::clearAuthorColors();
+        });
+        connect(
+          userSettingsPage_, &UserSettingsPage::themeChanged, chat_page_, &ChatPage::themeChanged);
         connect(trayIcon_,
                 SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
                 this,