Parcourir la source

misc: Remove custom themes in config.

Evan Husted il y a 1 an
Parent
commit
67ab54e2bb

+ 0 - 10
src/Ryujinx.UI.Common/Configuration/ConfigurationFileFormat.cs

@@ -298,16 +298,6 @@ namespace Ryujinx.UI.Common.Configuration
         /// </summary>
         public string LanguageCode { get; set; }
 
-        /// <summary>
-        /// Enable or disable custom themes in the GUI
-        /// </summary>
-        public bool EnableCustomTheme { get; set; }
-
-        /// <summary>
-        /// Path to custom GUI theme
-        /// </summary>
-        public string CustomThemePath { get; set; }
-
         /// <summary>
         /// Chooses the base style // Not Used
         /// </summary>

+ 5 - 23
src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs

@@ -144,16 +144,6 @@ namespace Ryujinx.UI.Common.Configuration
             /// </summary>
             public ReactiveObject<string> LanguageCode { get; private set; }
 
-            /// <summary>
-            /// Enable or disable custom themes in the GUI
-            /// </summary>
-            public ReactiveObject<bool> EnableCustomTheme { get; private set; }
-
-            /// <summary>
-            /// Path to custom GUI theme
-            /// </summary>
-            public ReactiveObject<string> CustomThemePath { get; private set; }
-
             /// <summary>
             /// Selects the base style
             /// </summary>
@@ -202,8 +192,6 @@ namespace Ryujinx.UI.Common.Configuration
                 AutoloadDirs = new ReactiveObject<List<string>>();
                 ShownFileTypes = new ShownFileTypeSettings();
                 WindowStartup = new WindowStartupSettings();
-                EnableCustomTheme = new ReactiveObject<bool>();
-                CustomThemePath = new ReactiveObject<string>();
                 BaseStyle = new ReactiveObject<string>();
                 StartFullscreen = new ReactiveObject<bool>();
                 GameListViewMode = new ReactiveObject<int>();
@@ -777,8 +765,6 @@ namespace Ryujinx.UI.Common.Configuration
                     WindowMaximized = UI.WindowStartup.WindowMaximized,
                 },
                 LanguageCode = UI.LanguageCode,
-                EnableCustomTheme = UI.EnableCustomTheme,
-                CustomThemePath = UI.CustomThemePath,
                 BaseStyle = UI.BaseStyle,
                 GameListViewMode = UI.GameListViewMode,
                 ShowNames = UI.ShowNames,
@@ -811,8 +797,8 @@ namespace Ryujinx.UI.Common.Configuration
             Graphics.MaxAnisotropy.Value = -1.0f;
             Graphics.AspectRatio.Value = AspectRatio.Fixed16x9;
             Graphics.GraphicsBackend.Value = DefaultGraphicsBackend();
-            Graphics.PreferredGpu.Value = "";
-            Graphics.ShadersDumpPath.Value = "";
+            Graphics.PreferredGpu.Value = string.Empty;
+            Graphics.ShadersDumpPath.Value = string.Empty;
             Logger.EnableDebug.Value = false;
             Logger.EnableStub.Value = true;
             Logger.EnableInfo.Value = true;
@@ -821,7 +807,7 @@ namespace Ryujinx.UI.Common.Configuration
             Logger.EnableTrace.Value = false;
             Logger.EnableGuest.Value = true;
             Logger.EnableFsAccessLog.Value = false;
-            Logger.FilteredClasses.Value = Array.Empty<LogClass>();
+            Logger.FilteredClasses.Value = [];
             Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
             System.Language.Value = Language.AmericanEnglish;
             System.Region.Value = Region.USA;
@@ -868,17 +854,15 @@ namespace Ryujinx.UI.Common.Configuration
             UI.GuiColumns.PathColumn.Value = true;
             UI.ColumnSort.SortColumnId.Value = 0;
             UI.ColumnSort.SortAscending.Value = false;
-            UI.GameDirs.Value = new List<string>();
-            UI.AutoloadDirs.Value = new List<string>();
+            UI.GameDirs.Value = [];
+            UI.AutoloadDirs.Value = [];
             UI.ShownFileTypes.NSP.Value = true;
             UI.ShownFileTypes.PFS0.Value = true;
             UI.ShownFileTypes.XCI.Value = true;
             UI.ShownFileTypes.NCA.Value = true;
             UI.ShownFileTypes.NRO.Value = true;
             UI.ShownFileTypes.NSO.Value = true;
-            UI.EnableCustomTheme.Value = true;
             UI.LanguageCode.Value = "en_US";
-            UI.CustomThemePath.Value = "";
             UI.BaseStyle.Value = "Dark";
             UI.GameListViewMode.Value = 0;
             UI.ShowNames.Value = true;
@@ -1628,9 +1612,7 @@ namespace Ryujinx.UI.Common.Configuration
             UI.ShownFileTypes.NCA.Value = configurationFileFormat.ShownFileTypes.NCA;
             UI.ShownFileTypes.NRO.Value = configurationFileFormat.ShownFileTypes.NRO;
             UI.ShownFileTypes.NSO.Value = configurationFileFormat.ShownFileTypes.NSO;
-            UI.EnableCustomTheme.Value = configurationFileFormat.EnableCustomTheme;
             UI.LanguageCode.Value = configurationFileFormat.LanguageCode;
-            UI.CustomThemePath.Value = configurationFileFormat.CustomThemePath;
             UI.BaseStyle.Value = configurationFileFormat.BaseStyle;
             UI.GameListViewMode.Value = configurationFileFormat.GameListViewMode;
             UI.ShowNames.Value = configurationFileFormat.ShowNames;

+ 3 - 9
src/Ryujinx/App.axaml.cs

@@ -58,11 +58,9 @@ namespace Ryujinx.Ava
 
             if (Program.PreviewerDetached)
             {
-                ApplyConfiguredTheme();
+                ApplyConfiguredTheme(ConfigurationState.Instance.UI.BaseStyle);
 
                 ConfigurationState.Instance.UI.BaseStyle.Event += ThemeChanged_Event;
-                ConfigurationState.Instance.UI.CustomThemePath.Event += ThemeChanged_Event;
-                ConfigurationState.Instance.UI.EnableCustomTheme.Event += CustomThemeChanged_Event;
             }
         }
 
@@ -88,17 +86,13 @@ namespace Ryujinx.Ava
                 }
             });
         }
-        
-        private void CustomThemeChanged_Event(object _, ReactiveEventArgs<bool> __) => ApplyConfiguredTheme();
 
-        private void ThemeChanged_Event(object _, ReactiveEventArgs<string> __) => ApplyConfiguredTheme();
+        private void ThemeChanged_Event(object _, ReactiveEventArgs<string> rArgs) => ApplyConfiguredTheme(rArgs.NewValue);
 
-        public void ApplyConfiguredTheme()
+        public void ApplyConfiguredTheme(string baseStyle)
         {
             try
             {
-                string baseStyle = ConfigurationState.Instance.UI.BaseStyle;
-
                 if (string.IsNullOrWhiteSpace(baseStyle))
                 {
                     ConfigurationState.Instance.UI.BaseStyle.Value = "Auto";