App icon; language/theme follow Windows on first run; flush save on exit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 14:52:25 +01:00
parent 5a8eba836b
commit 90898d7040
16 changed files with 107 additions and 36 deletions

26
Core/SystemPrefs.cs Normal file
View File

@@ -0,0 +1,26 @@
#nullable enable
using System.Globalization;
using Microsoft.Win32;
namespace ReminderOrganizer.Core
{
/// <summary>Defaults taken from Windows until the user picks something in the app.</summary>
public static class SystemPrefs
{
public static string Language(CultureInfo? culture = null) =>
(culture ?? CultureInfo.CurrentUICulture).TwoLetterISOLanguageName == "de" ? "de" : "en";
public static bool IsDarkMode()
{
try
{
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
return key?.GetValue("AppsUseLightTheme") is int v && v == 0;
}
catch
{
return true;
}
}
}
}