Просмотр исходного кода

UI: Don't re-apply theme when saving Settings

When the user changes theme, it is applied immediately. If the user
clicks Cancel, the previous theme is restored. This additional SetTheme
call was unnecessarily causing the existing theme to be re-applied,
resulting in a momentary hang without clear cause.
Matt Gajownik 3 лет назад
Родитель
Сommit
570c904977
1 измененных файлов с 1 добавлено и 4 удалено
  1. 1 4
      UI/window-basic-settings.cpp

+ 1 - 4
UI/window-basic-settings.cpp

@@ -3094,13 +3094,10 @@ void OBSBasicSettings::SaveGeneralSettings()
 	if (themeData == defaultTheme)
 	if (themeData == defaultTheme)
 		themeData = DEFAULT_THEME;
 		themeData = DEFAULT_THEME;
 
 
-	if (WidgetChanged(ui->theme)) {
+	if (WidgetChanged(ui->theme))
 		config_set_string(GetGlobalConfig(), "General", "CurrentTheme2",
 		config_set_string(GetGlobalConfig(), "General", "CurrentTheme2",
 				  QT_TO_UTF8(themeData));
 				  QT_TO_UTF8(themeData));
 
 
-		App()->SetTheme(themeData.toUtf8().constData());
-	}
-
 #if defined(_WIN32) || defined(__APPLE__)
 #if defined(_WIN32) || defined(__APPLE__)
 	if (WidgetChanged(ui->enableAutoUpdates))
 	if (WidgetChanged(ui->enableAutoUpdates))
 		config_set_bool(GetGlobalConfig(), "General",
 		config_set_bool(GetGlobalConfig(), "General",