From 4010c49c84e811b2c24177cd21b7a61ad0becc8f Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 19 Dec 2017 01:54:51 +0100 Subject: [PATCH] fixed messages not redrawing after changing theme --- src/widgets/basewidget.cpp | 6 +++++- src/widgets/settingsdialog.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/widgets/basewidget.cpp b/src/widgets/basewidget.cpp index 597e0e7b7..76c9121ce 100644 --- a/src/widgets/basewidget.cpp +++ b/src/widgets/basewidget.cpp @@ -51,11 +51,15 @@ float BaseWidget::getDpiMultiplier() void BaseWidget::init() { - this->colorScheme.updated.connect([this]() { + auto connection = this->colorScheme.updated.connect([this]() { this->refreshTheme(); this->update(); }); + + QObject::connect(this, &QObject::destroyed, [connection] { + connection.disconnect(); // + }); } void BaseWidget::initAsWindow() diff --git a/src/widgets/settingsdialog.cpp b/src/widgets/settingsdialog.cpp index efa879324..44d38fd31 100644 --- a/src/widgets/settingsdialog.cpp +++ b/src/widgets/settingsdialog.cpp @@ -290,6 +290,8 @@ QVBoxLayout *SettingsDialog::createAppearanceTab() combo->setCurrentText(currentComboText); QObject::connect(combo, &QComboBox::currentTextChanged, this, [](const QString &value) { + // dirty hack + EmoteManager::getInstance().incGeneration(); pajlada::Settings::Setting::set("/appearance/theme/name", value.toStdString()); });