Fix themeing

This commit is contained in:
Isaac Marovitz 2024-02-09 12:45:34 -05:00
parent 474a557e01
commit 5ec8af597e
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1

View file

@ -38,18 +38,17 @@ namespace Ryujinx.Ava
base.OnFrameworkInitializationCompleted();
if (Program.PreviewerDetached)
{
ApplyConfiguredTheme();
ConfigurationState.Instance.UI.BaseStyle.Event += ThemeChanged_Event;
ConfigurationState.Instance.UI.CustomThemePath.Event += ThemeChanged_Event;
ConfigurationState.Instance.UI.EnableCustomTheme.Event += CustomThemeChanged_Event;
}
else
if (!Program.PreviewerDetached)
{
ConfigurationState.Initialize();
}
ApplyConfiguredTheme();
ConfigurationState.Instance.Ui.BaseStyle.Event += ThemeChanged_Event;
ConfigurationState.Instance.Ui.CustomThemePath.Event += ThemeChanged_Event;
ConfigurationState.Instance.Ui.EnableCustomTheme.Event += CustomThemeChanged_Event;
}
private void CustomThemeChanged_Event(object sender, ReactiveEventArgs<bool> e)
@ -92,13 +91,13 @@ namespace Ryujinx.Ava
{
try
{
string baseStyle = ConfigurationState.Instance.UI.BaseStyle;
string baseStyle = ConfigurationState.Instance.Ui.BaseStyle;
if (string.IsNullOrWhiteSpace(baseStyle))
{
ConfigurationState.Instance.UI.BaseStyle.Value = "Dark";
ConfigurationState.Instance.Ui.BaseStyle.Value = "Dark";
baseStyle = ConfigurationState.Instance.UI.BaseStyle;
baseStyle = ConfigurationState.Instance.Ui.BaseStyle;
}
RequestedThemeVariant = baseStyle switch