Merge pull request #1851 from cg2121/fix-theme-selection

UI: Fix theme bug when updating from older versions
This commit is contained in:
Jim 2019-04-24 04:31:10 -07:00 committed by GitHub
commit 314a31d973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1029,21 +1029,20 @@ bool OBSApp::InitTheme()
const char *themeName = config_get_string(globalConfig, "General",
"CurrentTheme");
if (themeName && strcmp(themeName, "Default") == 0)
themeName = "System";
if (!themeName) {
/* Use deprecated "Theme" value if available */
themeName = config_get_string(globalConfig,
"General", "Theme");
if (!themeName)
themeName = DEFAULT_THEME;
if (!themeName)
themeName = "Dark";
}
if (strcmp(themeName, DEFAULT_THEME) != 0 && SetTheme(themeName))
return true;
if (strcmp(themeName, "Default") == 0)
themeName = "System";
return SetTheme(DEFAULT_THEME);
return SetTheme(themeName);
}
OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store)