diff options
author | redsky17 <joedonofry@gmail.com> | 2019-01-20 04:43:48 +0000 |
---|---|---|
committer | redsky17 <joedonofry@gmail.com> | 2019-01-20 04:43:48 +0000 |
commit | 237c7ad114b7c3d6960fdaf712b600e715eff082 (patch) | |
tree | 77f9f2f3f8eb6256a538e653bd1ed2b615fd8625 /src/MainWindow.cpp | |
parent | Update user id color generation (diff) | |
download | nheko-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.cpp | 6 |
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, |