Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

fix(theme): apply theme before accent so fill default resolves correctly

fatDuck68fa1a372df4
diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.cs
index 40d4eff..17f4497 100644
--- a/optimizerDuck/App.xaml.cs
+++ b/optimizerDuck/App.xaml.cs
@@ -444,8 +444,8 @@ public partial class App : Application
await Dispatcher.InvokeAsync(() =>
{
- ApplyAccentFor(appSettings.App.Theme);
-
+ // Theme first: ApplyAccentFor reads GetAppTheme() cache to pick
+ // AccentFillColorDefault (secondary for Dark, primary for Light).
ApplicationThemeManager.Apply(
appSettings.App.Theme switch
{
@@ -455,6 +455,7 @@ public partial class App : Application
},
updateAccent: false
);
+ ApplyAccentFor(appSettings.App.Theme);
var mainWindow = _host.Services.GetRequiredService<MainWindow>();
mainWindow.Closing += MainWindow_Closing;
diff --git a/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs b/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
index 0f2540c..78fe083 100644
--- a/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
@@ -82,8 +82,10 @@ public partial class LegalDialogViewModel(
{
if (!IsInitialized)
return;
- App.ApplyAccentFor(newValue);
+ // Theme first: ApplyAccentFor reads GetAppTheme() cache to pick
+ // AccentFillColorDefault (secondary for Dark, primary for Light).
ApplicationThemeManager.Apply(newValue, updateAccent: false);
+ App.ApplyAccentFor(newValue);
_ = SafeFireAndForgetAsync(
async () => await configManager.SetAsync(x => x.App.Theme, newValue),
async () =>
diff --git a/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
index 6222bdd..bd1ce73 100644
--- a/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
@@ -378,8 +378,10 @@ public partial class SettingsViewModel(
{
if (!IsInitialized)
return;
- App.ApplyAccentFor(newValue);
+ // Theme first: ApplyAccentFor reads GetAppTheme() cache to pick
+ // AccentFillColorDefault (secondary for Dark, primary for Light).
ApplicationThemeManager.Apply(newValue, updateAccent: false);
+ App.ApplyAccentFor(newValue);
_ = SaveConfigAsync(
async () =>