From 5ec8af597ee558e771420ee84d117070d0b44e4d Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 9 Feb 2024 12:45:34 -0500 Subject: [PATCH] Fix themeing --- src/Ryujinx.Ava/App.axaml.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Ryujinx.Ava/App.axaml.cs b/src/Ryujinx.Ava/App.axaml.cs index f27038aed..11325dcb6 100644 --- a/src/Ryujinx.Ava/App.axaml.cs +++ b/src/Ryujinx.Ava/App.axaml.cs @@ -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 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