diff --git a/src/CommandForge.Wpf/App.xaml.cs b/src/CommandForge.Wpf/App.xaml.cs index e6207d1..15c7877 100644 --- a/src/CommandForge.Wpf/App.xaml.cs +++ b/src/CommandForge.Wpf/App.xaml.cs @@ -83,6 +83,13 @@ public partial class App : System.Windows.Application private void ApplyUserPreferences() { var settings = _host!.Services.GetRequiredService(); + + // Recreate config.json with defaults if it was deleted while the app was closed. + if (!File.Exists(AppPaths.ConfigFilePath)) + { + settings.Save(); + } + LocalizationManager.Instance.SetCulture(ResolveCulture(settings.Language)); _host.Services.GetRequiredService().Apply(settings.FontSize); _host.Services.GetRequiredService().Apply(settings.Theme); diff --git a/src/CommandForge.Wpf/Theming/ThemeService.cs b/src/CommandForge.Wpf/Theming/ThemeService.cs index 25c0ac4..778a97d 100644 --- a/src/CommandForge.Wpf/Theming/ThemeService.cs +++ b/src/CommandForge.Wpf/Theming/ThemeService.cs @@ -1,3 +1,4 @@ +using System.Windows.Media; using CommandForge.Application.Settings; using MaterialDesignThemes.Wpf; using Microsoft.Win32; @@ -11,6 +12,11 @@ namespace CommandForge.Wpf.Theming; /// public sealed class ThemeService : IThemeService, IDisposable { + // Deep Purple 500 reads well on light backgrounds; a lighter Deep Purple 200 keeps the accent + // legible on dark backgrounds (the mid hue drives flat-button text, tabs, selection and the star). + private static readonly Color LightPrimary = Color.FromRgb(0x67, 0x3A, 0xB7); + private static readonly Color DarkPrimary = Color.FromRgb(0xB3, 0x9D, 0xDB); + private AppTheme _current = AppTheme.System; private bool _subscribed; @@ -29,6 +35,7 @@ public sealed class ThemeService : IThemeService, IDisposable var palette = new PaletteHelper(); var current = palette.GetTheme(); current.SetBaseTheme(baseTheme); + current.SetPrimaryColor(baseTheme == BaseTheme.Dark ? DarkPrimary : LightPrimary); palette.SetTheme(current); if (theme == AppTheme.System) diff --git a/src/CommandForge.Wpf/Views/HomeView.xaml b/src/CommandForge.Wpf/Views/HomeView.xaml index 1622b19..14925aa 100644 --- a/src/CommandForge.Wpf/Views/HomeView.xaml +++ b/src/CommandForge.Wpf/Views/HomeView.xaml @@ -13,8 +13,10 @@ +