From bb04c961bcf42488c950bf58ea61bf2daacd1d31 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Sat, 7 Dec 2019 10:20:57 -0800 Subject: [PATCH] UI: Don't modify theme if already set This includes reselecting the existing selection, and cancelling out of settings altogether. Takes a long time (7 seconds) in debug builds. --- UI/window-basic-settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index c14f87b9f..85d78f4e0 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -3509,7 +3509,8 @@ void OBSBasicSettings::on_theme_activated(int idx) if (currT == defaultTheme) currT = DEFAULT_THEME; - App()->SetTheme(currT.toUtf8().constData()); + if (currT != App()->GetTheme()) + App()->SetTheme(currT.toUtf8().constData()); } void OBSBasicSettings::on_listWidget_itemSelectionChanged() @@ -3535,7 +3536,8 @@ void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button) if (val == QDialogButtonBox::AcceptRole || val == QDialogButtonBox::RejectRole) { if (val == QDialogButtonBox::RejectRole) { - App()->SetTheme(savedTheme); + if (savedTheme != App()->GetTheme()) + App()->SetTheme(savedTheme); #ifdef _WIN32 if (toggleAero) SetAeroEnabled(!aeroWasDisabled);