This commit is contained in:
Usman Shafiq
2022-03-24 02:28:01 -04:00
2 changed files with 15 additions and 0 deletions

View File

@@ -415,6 +415,11 @@ namespace VRCX
return System.Globalization.CultureInfo.CurrentCulture.ToString();
}
public void ChangeTheme(int value)
{
WinformThemer.SetGlobalTheme(value);
}
public void SetStartup(bool enabled)
{
try

View File

@@ -11397,8 +11397,18 @@ speechSynthesis.getVoices();
$app.watch.isDarkMode = function () {
configRepository.setBool('isDarkMode', this.isDarkMode);
$appDarkStyle.disabled = this.isDarkMode === false;
if (this.isDarkMode) {
AppApi.ChangeTheme(1);
} else {
AppApi.ChangeTheme(0);
}
this.updateVRConfigVars();
};
if ($app.data.isDarkMode) {
AppApi.ChangeTheme(1);
} else {
AppApi.ChangeTheme(0);
}
window
.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', (e) => {