diff --git a/src/Launcher/Sucrose.Launcher/App.xaml.cs b/src/Launcher/Sucrose.Launcher/App.xaml.cs index 680085a95..9cbf7cecd 100644 --- a/src/Launcher/Sucrose.Launcher/App.xaml.cs +++ b/src/Launcher/Sucrose.Launcher/App.xaml.cs @@ -110,7 +110,7 @@ protected void Message(string Message) string Path = SMMI.LauncherLogManager.LogFile(); - switch (SSLMM.Theme) + switch (SSLMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.Aurora/App.xaml.cs b/src/Live/Sucrose.Live.Aurora/App.xaml.cs index 6aeb1f928..456ae9242 100644 --- a/src/Live/Sucrose.Live.Aurora/App.xaml.cs +++ b/src/Live/Sucrose.Live.Aurora/App.xaml.cs @@ -104,7 +104,7 @@ protected void Message(string Message) string Path = SMMI.AuroraLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.CefSharp/App.xaml.cs b/src/Live/Sucrose.Live.CefSharp/App.xaml.cs index 9323cca10..fe4d8fa6f 100644 --- a/src/Live/Sucrose.Live.CefSharp/App.xaml.cs +++ b/src/Live/Sucrose.Live.CefSharp/App.xaml.cs @@ -114,7 +114,7 @@ protected void Message(string Message) string Path = SMMI.CefSharpLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs b/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs index a94b6c316..1ed86578a 100644 --- a/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs +++ b/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs @@ -104,7 +104,7 @@ protected void Message(string Message) string Path = SMMI.MpvPlayerLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.Nebula/App.xaml.cs b/src/Live/Sucrose.Live.Nebula/App.xaml.cs index 90f98d1a6..0ef3be3b5 100644 --- a/src/Live/Sucrose.Live.Nebula/App.xaml.cs +++ b/src/Live/Sucrose.Live.Nebula/App.xaml.cs @@ -104,7 +104,7 @@ protected void Message(string Message) string Path = SMMI.NebulaLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.Vexana/App.xaml.cs b/src/Live/Sucrose.Live.Vexana/App.xaml.cs index af4b716f9..03a88062f 100644 --- a/src/Live/Sucrose.Live.Vexana/App.xaml.cs +++ b/src/Live/Sucrose.Live.Vexana/App.xaml.cs @@ -104,7 +104,7 @@ protected void Message(string Message) string Path = SMMI.VexanaLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Live/Sucrose.Live.WebView/App.xaml.cs b/src/Live/Sucrose.Live.WebView/App.xaml.cs index 0443de853..104bbc8e8 100644 --- a/src/Live/Sucrose.Live.WebView/App.xaml.cs +++ b/src/Live/Sucrose.Live.WebView/App.xaml.cs @@ -114,7 +114,7 @@ protected void Message(string Message) string Path = SMMI.WebViewLiveLogManager.LogFile(); - switch (SSEMM.Theme) + switch (SSEMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Portal/Sucrose.Portal/App.xaml.cs b/src/Portal/Sucrose.Portal/App.xaml.cs index 89bffc04d..a367bbf50 100644 --- a/src/Portal/Sucrose.Portal/App.xaml.cs +++ b/src/Portal/Sucrose.Portal/App.xaml.cs @@ -202,7 +202,7 @@ protected void Message(string Message) string Path = SMMI.PortalLogManager.LogFile(); - switch (SPMM.Theme) + switch (SPMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path); diff --git a/src/Portal/Sucrose.Portal/Manage/Manager.cs b/src/Portal/Sucrose.Portal/Manage/Manager.cs index 5daf3d072..df86a573e 100644 --- a/src/Portal/Sucrose.Portal/Manage/Manager.cs +++ b/src/Portal/Sucrose.Portal/Manage/Manager.cs @@ -55,9 +55,9 @@ internal static class Manager public static SSDEDT DisplayType => SMMI.EngineSettingManager.GetSetting(SMC.DisplayType, SSDEDT.Screen); - public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill); + public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); - public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); + public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill); public static WindowBackdropType DefaultBackdropType => WindowBackdropType.None; diff --git a/src/Portal/Sucrose.Portal/ViewModels/Pages/Setting/GeneralSettingViewModel.cs b/src/Portal/Sucrose.Portal/ViewModels/Pages/Setting/GeneralSettingViewModel.cs index bc69f3a7a..4616ad352 100644 --- a/src/Portal/Sucrose.Portal/ViewModels/Pages/Setting/GeneralSettingViewModel.cs +++ b/src/Portal/Sucrose.Portal/ViewModels/Pages/Setting/GeneralSettingViewModel.cs @@ -485,7 +485,7 @@ private void BackdropSelected(int Index) ApplicationTheme Theme = ApplicationTheme.Dark; WindowBackdropType Type = (WindowBackdropType)Index; - if (SPMM.Theme == SEWTT.Light) + if (SPMM.ThemeType == SEWTT.Light) { Theme = ApplicationTheme.Light; } diff --git a/src/Portal/Sucrose.Portal/ViewModels/Windows/MainWindowViewModel.cs b/src/Portal/Sucrose.Portal/ViewModels/Windows/MainWindowViewModel.cs index 7202e27fd..0bdb4f891 100644 --- a/src/Portal/Sucrose.Portal/ViewModels/Windows/MainWindowViewModel.cs +++ b/src/Portal/Sucrose.Portal/ViewModels/Windows/MainWindowViewModel.cs @@ -185,7 +185,7 @@ private static WindowBackdropType GetWindowBackdropType() [RelayCommand] private void OnChangeTheme() { - if (SPMM.Theme == SEWTT.Dark) + if (SPMM.ThemeType == SEWTT.Dark) { SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Light); WUAT.Apply(WUAAT.Light, GetWindowBackdropType(), true, true); diff --git a/src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml.cs b/src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml.cs index 37a1fd3c8..2bfc4e519 100644 --- a/src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml.cs +++ b/src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml.cs @@ -15,6 +15,9 @@ using SSDEACT = Sucrose.Shared.Dependency.Enum.ArgumentCommandsType; using WUAAT = Wpf.Ui.Appearance.ApplicationTheme; using WUAT = Wpf.Ui.Appearance.ApplicationThemeManager; +using SWHWT = Skylark.Wing.Helper.WindowsTheme; +using SMMI = Sucrose.Manager.Manage.Internal; +using SMC = Sucrose.Memory.Constant; namespace Sucrose.Portal.Views.Windows { @@ -32,15 +35,33 @@ public MainWindow(SPVMWMWVM ViewModel, INavigationService NavigationService, ISe InitializeComponent(); - if (SPMM.Theme == SEWTT.Dark) + if (SPMM.BackdropType == WindowBackdropType.Auto) { - WUAT.Apply(WUAAT.Dark); - Light.Visibility = Visibility.Collapsed; + if (SWHWT.GetTheme() == SEWTT.Dark) + { + WUAT.Apply(WUAAT.Dark); + Light.Visibility = Visibility.Collapsed; + SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Dark); + } + else + { + WUAT.Apply(WUAAT.Light); + Dark.Visibility = Visibility.Collapsed; + SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Light); + } } else { - WUAT.Apply(WUAAT.Light); - Dark.Visibility = Visibility.Collapsed; + if (SPMM.ThemeType == SEWTT.Dark) + { + WUAT.Apply(WUAAT.Dark); + Light.Visibility = Visibility.Collapsed; + } + else + { + WUAT.Apply(WUAAT.Light); + Dark.Visibility = Visibility.Collapsed; + } } RootView.SetServiceProvider(ServiceProvider); diff --git a/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Manager.cs b/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Manager.cs index 857f11ccf..7f1d0bb8d 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Manager.cs +++ b/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Manager.cs @@ -27,9 +27,9 @@ internal static class Manager public static SSDEDT DisplayType => SMMI.EngineSettingManager.GetSetting(SMC.DisplayType, SSDEDT.Screen); - public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill); + public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); - public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); + public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill); public static SSDEST DefaultStretchType => SSDEST.None; diff --git a/src/Shared/Sucrose.Shared.Launcher/Command/Report.cs b/src/Shared/Sucrose.Shared.Launcher/Command/Report.cs index 085398b0c..cb4be2693 100644 --- a/src/Shared/Sucrose.Shared.Launcher/Command/Report.cs +++ b/src/Shared/Sucrose.Shared.Launcher/Command/Report.cs @@ -14,7 +14,7 @@ public static void Command() { SSLMI.ReportBox = false; - switch (SSLMM.Theme) + switch (SSLMM.ThemeType) { case SEWTT.Dark: SSLVDRB DarkReportBox = new(); diff --git a/src/Shared/Sucrose.Shared.Launcher/Manage/Manager.cs b/src/Shared/Sucrose.Shared.Launcher/Manage/Manager.cs index 5b5acf61a..fa1395254 100644 --- a/src/Shared/Sucrose.Shared.Launcher/Manage/Manager.cs +++ b/src/Shared/Sucrose.Shared.Launcher/Manage/Manager.cs @@ -8,7 +8,7 @@ namespace Sucrose.Shared.Launcher.Manage { internal static class Manager { - public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); + public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); public static Mutex Mutex => new(true, SMR.LauncherMutex); } diff --git a/src/Shared/Sucrose.Shared.Launcher/Manager/TrayIconManager.cs b/src/Shared/Sucrose.Shared.Launcher/Manager/TrayIconManager.cs index 66cda6cec..e0d918cfc 100644 --- a/src/Shared/Sucrose.Shared.Launcher/Manager/TrayIconManager.cs +++ b/src/Shared/Sucrose.Shared.Launcher/Manager/TrayIconManager.cs @@ -60,7 +60,7 @@ public void Initialize() SSLHR.Corner(ContextMenu); - if (SSLMM.Theme == SEWTT.Dark) + if (SSLMM.ThemeType == SEWTT.Dark) { ContextMenu.Renderer = new SSLRDR(); } @@ -71,7 +71,7 @@ public void Initialize() ContextMenu.Items.Add(SSRER.GetValue("Launcher", "OpenText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "OpenIcon"))), CommandInterface); - SSLSSS Separator1 = new(SSLMM.Theme); + SSLSSS Separator1 = new(SSLMM.ThemeType); if (SSSHL.Run() && (!SMMM.PausePerformance || !SSSHP.Work(SSSMI.Backgroundog))) { @@ -116,14 +116,14 @@ public void Initialize() } } - SSLSSS Separator2 = new(SSLMM.Theme); + SSLSSS Separator2 = new(SSLMM.ThemeType); ContextMenu.Items.Add(Separator2.Strip); ContextMenu.Items.Add(SSRER.GetValue("Launcher", "SettingText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "SettingIcon"))), CommandSetting); ContextMenu.Items.Add(SSRER.GetValue("Launcher", "ReportText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "ReportIcon"))), CommandReport); ContextMenu.Items.Add(SSRER.GetValue("Launcher", "UpdateText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "UpdateIcon"))), CommandUpdate); - SSLSSS Separator3 = new(SSLMM.Theme); + SSLSSS Separator3 = new(SSLMM.ThemeType); ContextMenu.Items.Add(Separator3.Strip); ContextMenu.Items.Add(SSRER.GetValue("Launcher", "ExitText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "ExitIcon"))), CommandClose); diff --git a/src/Update/Sucrose.Update/App.xaml.cs b/src/Update/Sucrose.Update/App.xaml.cs index d226b7446..3982dd827 100644 --- a/src/Update/Sucrose.Update/App.xaml.cs +++ b/src/Update/Sucrose.Update/App.xaml.cs @@ -111,7 +111,7 @@ protected void Close() internal void Info(SSDEUT Type) { - switch (SUMM.Theme) + switch (SUMM.ThemeType) { case SEWTT.Dark: SUVDIB DarkInfoBox = new(Type); @@ -134,7 +134,7 @@ protected void Message(string Message) string Path = SMMI.UpdateLogManager.LogFile(); string Text = SSRER.GetValue("Update", "HelpText"); - switch (SUMM.Theme) + switch (SUMM.ThemeType) { case SEWTT.Dark: SSWDEMB DarkMessageBox = new(Message, Path, Source, Text) @@ -306,7 +306,7 @@ protected async void Configure() if (Result == SSDECT.Pass) { - switch (SUMM.Theme) + switch (SUMM.ThemeType) { case SEWTT.Dark: SUVDUB DarkUpdateBox = new(Bundle); diff --git a/src/Update/Sucrose.Update/Manage/Manager.cs b/src/Update/Sucrose.Update/Manage/Manager.cs index 715c19035..3fe7d9133 100644 --- a/src/Update/Sucrose.Update/Manage/Manager.cs +++ b/src/Update/Sucrose.Update/Manage/Manager.cs @@ -11,7 +11,7 @@ internal static class Manager { public static string CachePath => Path.Combine(SMR.AppDataPath, SMR.AppName, SMR.CacheFolder, SMR.Bundle); - public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); + public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme()); public static Mutex Mutex => new(true, SMR.UpdateMutex); }