Professional redesign: native window, settings, calmer UI

- WindowChrome: resizable, snap layouts, native shadow, DWM rounded
  corners; size/position remembered; fade-in after load (no theme flash)
- Menu bar replaced by a settings window (theme system/light/dark,
  language, sound, autostart, categories, data, shortcuts, about)
- Shared styles in Themes/Controls.xaml; neutral palette with one accent
  applied to Application.Resources (context menus/tooltips themed)
- Rows: To-Do style check left, title + details, relative date right,
  actions on hover, visible selection (Enter edits, Del deletes)
- No glow/scale effects; subtle animations (dialogs, snackbar, chevrons)
- Checking a recurring task moves it to the next date (with undo)
- Themed combo box, date picker, check box; neutral dialog headers
- New flat app icon (tools/make_icon.py)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-29 18:10:45 +01:00
parent 00e9990feb
commit 3e0b00f11c
28 changed files with 2100 additions and 1434 deletions

View File

@@ -4,6 +4,11 @@
xmlns:converters="clr-namespace:ReminderOrganizer.Converters" xmlns:converters="clr-namespace:ReminderOrganizer.Converters"
ShutdownMode="OnExplicitShutdown"> ShutdownMode="OnExplicitShutdown">
<Application.Resources> <Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Controls.xaml"/>
</ResourceDictionary.MergedDictionaries>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibility"/> <converters:BoolToVisibilityConverter x:Key="BoolToVisibility"/>
<converters:NullToVisibilityConverter x:Key="NullToVisibility"/> <converters:NullToVisibilityConverter x:Key="NullToVisibility"/>
<converters:ZeroToVisibilityConverter x:Key="ZeroToVisibility"/> <converters:ZeroToVisibilityConverter x:Key="ZeroToVisibility"/>
@@ -14,5 +19,7 @@
<converters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibility"/> <converters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibility"/>
<converters:BucketHeaderConverter x:Key="BucketHeader"/> <converters:BucketHeaderConverter x:Key="BucketHeader"/>
<converters:HexToBrushConverter x:Key="HexToBrush"/> <converters:HexToBrushConverter x:Key="HexToBrush"/>
<converters:ReferenceEqualsConverter x:Key="RefEquals"/>
</ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@@ -41,6 +41,13 @@ namespace ReminderOrganizer
private System.Threading.Mutex? _singleInstance; private System.Threading.Mutex? _singleInstance;
/// <summary>Really exit (tray menu / "Exit"): the main window otherwise only hides to the tray.</summary>
public static void Quit()
{
(Current.MainWindow as MainWindow)?.AllowClose();
Current.Shutdown();
}
protected override void OnExit(ExitEventArgs e) protected override void OnExit(ExitEventArgs e)
{ {
(MainWindow as MainWindow)?.OnAppExit(); (MainWindow as MainWindow)?.OnAppExit();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -12,9 +12,14 @@ services through `ServiceLocator` (Microsoft.Extensions.DependencyInjection).
- Anniversaries: `ReminderTask.IsAnniversary` (stored as JSON `"IsBirthday"` for older files) + `CategoryId` - Anniversaries: `ReminderTask.IsAnniversary` (stored as JSON `"IsBirthday"` for older files) + `CategoryId`
→ `Models/Category.cs` (presets birthday/wedding/jubilee/memorial + own ones, text with `{0}`/`{o}`). → `Models/Category.cs` (presets birthday/wedding/jubilee/memorial + own ones, text with `{0}`/`{o}`).
Filter/sort/group rules are in `Core/TaskQuery.cs` (pure, tested). Filter/sort/group rules are in `Core/TaskQuery.cs` (pure, tested).
- `Core/Theme.cs`: the only light/dark palette, used by MainWindow and the dialogs (`Theme.Apply(Resources, dark)`). - `Core/Theme.cs`: the only light/dark palette (neutral greys + one accent), applied to **Application.Resources**
- `MainWindow.xaml`: custom chrome (WindowStyle=None). Icons are Segoe MDL2 glyphs or Path geometry, **no emojis** (so context menus, tooltips and dialogs follow). Theme mode system/light/dark in settings.
(they don't follow the theme). - `Themes/Controls.xaml`: all shared styles (menus, tooltips, scrollbars, combo box, date picker, check box,
buttons `PrimaryButton`/`SubtleButton`/`IconButton`, `Segment`, `ToggleSwitch`, `DoneCheck`). Change looks here, not per window.
- `MainWindow.xaml`: `WindowChrome` (native resize/snap/shadow, DWM rounded corners), no menu bar: settings gear
→ `SettingsWindow`. Row actions appear on hover. Icons are Segoe Fluent/MDL2 glyphs or Path geometry, **no emojis**.
- Design rules: no glow, no scaling on hover, animations only 120–200 ms and only where they carry meaning
(dialog open, snackbar, group chevron, toggle knob, window fade-in).
- `Tests/`: xUnit project, excluded from the app csproj via `Compile Remove`. - `Tests/`: xUnit project, excluded from the app csproj via `Compile Remove`.
## Rules ## Rules
@@ -25,6 +30,9 @@ services through `ServiceLocator` (Microsoft.Extensions.DependencyInjection).
- Run `dotnet test Tests\ReminderOrganizer.Tests.csproj` before each release. `release.bat` does this automatically. - Run `dotnet test Tests\ReminderOrganizer.Tests.csproj` before each release. `release.bat` does this automatically.
## Graphics ## Graphics
App icon is drawn, not generated: `py -3.12 tools\make_icon.py <out.png>` (rounded square + Fluent bell), then
save as `Assets\app.png` (256) and `Assets\app.ico` (16–256). Older ComfyUI notes below.
`sprite-generator\` = ComfyGen template (`_Tools\ComfyGen`). App icon: `gen generate icon` → `gen adopt --size 512 icon` `sprite-generator\` = ComfyGen template (`_Tools\ComfyGen`). App icon: `gen generate icon` → `gen adopt --size 512 icon`
→ convert `Assets\Sprites\icon.png` to `Assets\app.ico` (Pillow, sizes 16–256). The csproj and MainWindow pick up → convert `Assets\Sprites\icon.png` to `Assets\app.ico` (Pillow, sizes 16–256). The csproj and MainWindow pick up
`Assets\app.ico` automatically (window, tray, exe). Without the file, the default icon is used. `Assets\app.ico` automatically (window, tray, exe). Without the file, the default icon is used.

View File

@@ -59,7 +59,7 @@
</Style> </Style>
</Window.Resources> </Window.Resources>
<Border CornerRadius="12" Background="{DynamicResource CardBrush}" Margin="8"> <Border CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="10">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/> <DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/>
</Border.Effect> </Border.Effect>
@@ -72,14 +72,13 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Header --> <!-- Header -->
<Border Background="{DynamicResource PrimaryBrush}" CornerRadius="12,12,0,0" Padding="16,10"> <Border Background="Transparent" CornerRadius="12,12,0,0" Padding="20,14,12,6">
<Grid> <Grid>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE8EC;" FontFamily="Segoe MDL2 Assets" FontSize="15" Foreground="White" VerticalAlignment="Center"/> <TextBlock Text="&#xE8EC;" FontFamily="Segoe MDL2 Assets" FontSize="15" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding [Categories]}" FontSize="14" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="10,0,0,0"/> <TextBlock Text="{Binding [Categories]}" FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
<Button Content="&#xE8BB;" FontFamily="Segoe MDL2 Assets" FontSize="10" HorizontalAlignment="Right" Foreground="White" <Button Content="&#xE8BB;" Style="{StaticResource IconButton}" FontSize="10" HorizontalAlignment="Right" Click="Cancel_Click" IsCancel="True"/>
Background="Transparent" BorderThickness="0" Width="28" Height="28" Cursor="Hand" Click="Cancel_Click" IsCancel="True"/>
</Grid> </Grid>
</Border> </Border>

View File

@@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@@ -29,6 +29,7 @@ namespace ReminderOrganizer
public CategoryWindow(IEnumerable<Category> categories, bool darkMode, Func<string, int> usageCount) public CategoryWindow(IEnumerable<Category> categories, bool darkMode, Func<string, int> usageCount)
{ {
InitializeComponent(); InitializeComponent();
DialogAnimation.Attach(this);
Theme.Apply(Resources, darkMode); Theme.Apply(Resources, darkMode);
_loc = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!; _loc = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!;
_usage = usageCount; _usage = usageCount;

View File

@@ -18,6 +18,16 @@ namespace ReminderOrganizer.Converters
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
} }
/// <summary>true if both values are the same object (row == selected task).</summary>
public class ReferenceEqualsConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) =>
values.Length == 2 && values[0] != null && ReferenceEquals(values[0], values[1]);
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) =>
throw new NotSupportedException();
}
/// <summary>Task → first day of its month (group key for month grouping).</summary> /// <summary>Task → first day of its month (group key for month grouping).</summary>
public class MonthKeyConverter : IValueConverter public class MonthKeyConverter : IValueConverter
{ {

33
Core/DialogAnimation.cs Normal file
View File

@@ -0,0 +1,33 @@
#nullable enable
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace ReminderOrganizer
{
/// <summary>Subtle open animation for dialogs: fade in + 2 % scale, 140 ms, ease-out.</summary>
public static class DialogAnimation
{
public static void Attach(Window window)
{
window.Opacity = 0;
window.Loaded += (_, _) =>
{
var ease = new CubicEase { EasingMode = EasingMode.EaseOut };
var duration = TimeSpan.FromMilliseconds(140);
window.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(0, 1, duration) { EasingFunction = ease });
if (window.Content is FrameworkElement root)
{
var scale = new ScaleTransform(0.98, 0.98);
root.RenderTransformOrigin = new Point(0.5, 0.5);
root.RenderTransform = scale;
var anim = new DoubleAnimation(0.98, 1, duration) { EasingFunction = ease };
scale.BeginAnimation(ScaleTransform.ScaleXProperty, anim);
scale.BeginAnimation(ScaleTransform.ScaleYProperty, anim);
}
};
}
}
}

View File

@@ -4,53 +4,80 @@ using System.Windows.Media;
namespace ReminderOrganizer.Core namespace ReminderOrganizer.Core
{ {
/// <summary>One place for the light/dark palette – used by the main window and all dialogs.</summary> /// <summary>
/// One place for the light/dark palette. Neutral greys + a single muted accent (Fluent-like).
/// Applied to Application.Resources so context menus, tooltips and dialogs all follow the theme.
/// </summary>
public static class Theme public static class Theme
{ {
private static SolidColorBrush B(uint rgb) public static bool IsDark { get; private set; } = true;
private static SolidColorBrush B(uint rgb, byte alpha = 255)
{ {
var b = new SolidColorBrush(Color.FromRgb((byte)(rgb >> 16), (byte)(rgb >> 8), (byte)rgb)); var b = new SolidColorBrush(Color.FromArgb(alpha, (byte)(rgb >> 16), (byte)(rgb >> 8), (byte)rgb));
b.Freeze(); b.Freeze();
return b; return b;
} }
public static void Apply(ResourceDictionary res, bool dark) public static void Apply(ResourceDictionary res, bool dark)
{ {
if (ReferenceEquals(res, Application.Current?.Resources)) IsDark = dark;
// shared
res["PrimaryBrush"] = B(0x5B5BD6);
res["PrimaryHoverBrush"] = B(0x4C4CC4);
res["DangerBrush"] = B(dark ? 0xF0706AU : 0xD93A34U);
res["WarningBrush"] = B(0xE5A00D);
res["SuccessBrush"] = B(dark ? 0x3DD68CU : 0x18A058U);
res["SecondaryBrush"] = res["SuccessBrush"];
if (dark) if (dark)
{ {
res["SidebarBrush"] = B(0x1A1A24); res["BackgroundBrush"] = B(0x16161A);
res["CardBrush"] = B(0x22222E); res["SidebarBrush"] = B(0x1C1C21);
res["TextPrimaryBrush"] = B(0xF5F5F5); res["HeaderBrush"] = B(0x1C1C21);
res["TextSecondaryBrush"] = B(0xA8A8BC); res["CardBrush"] = B(0x202026);
res["BorderBrush"] = B(0x3A3A4A); res["MenuBackgroundBrush"] = B(0x26262D);
res["BackgroundBrush"] = B(0x121218); res["InputBackgroundBrush"] = B(0x1A1A1F);
res["HoverBrush"] = B(0x2A2A3A); res["BorderBrush"] = B(0x2E2E36);
res["SidebarTextBrush"] = B(0xF5F5F5); res["DividerBrush"] = B(0x2A2A31);
res["SidebarSecondaryBrush"] = B(0x9999AA); res["HoverBrush"] = B(0x2A2A31);
res["MenuBackgroundBrush"] = B(0x22222E); res["SelectedBrush"] = B(0x2B2B45);
res["PrimaryLightBrush"] = B(0x37345F); res["TextPrimaryBrush"] = B(0xEDEDF2);
res["HeaderBrush"] = B(0x22222E); res["TextSecondaryBrush"] = B(0x9C9CA8);
res["InputBackgroundBrush"] = B(0x2A2A38); res["TextTertiaryBrush"] = B(0x6E6E7A);
res["BadgeBrush"] = B(0x37345F); res["SidebarTextBrush"] = B(0xDCDCE4);
res["BadgeTextBrush"] = B(0xC7C8FF); res["SidebarSecondaryBrush"] = B(0x80808C);
res["AccentSubtleBrush"] = B(0x2D2D4C);
res["AccentTextBrush"] = B(0xB9BAFF);
res["PrimaryLightBrush"] = res["AccentSubtleBrush"];
res["BadgeBrush"] = B(0x2D2D4C);
res["BadgeTextBrush"] = B(0xB9BAFF);
res["SnackbarBrush"] = B(0x33333C);
} }
else else
{ {
res["SidebarBrush"] = B(0xF8FAFC); res["BackgroundBrush"] = B(0xF6F7F9);
res["SidebarBrush"] = B(0xEEF0F3);
res["HeaderBrush"] = B(0xEEF0F3);
res["CardBrush"] = B(0xFFFFFF); res["CardBrush"] = B(0xFFFFFF);
res["TextPrimaryBrush"] = B(0x1E293B);
res["TextSecondaryBrush"] = B(0x64748B);
res["BorderBrush"] = B(0xE2E8F0);
res["BackgroundBrush"] = B(0xF1F5F9);
res["HoverBrush"] = B(0xE2E8F0);
res["SidebarTextBrush"] = B(0x1E293B);
res["SidebarSecondaryBrush"] = B(0x64748B);
res["MenuBackgroundBrush"] = B(0xFFFFFF); res["MenuBackgroundBrush"] = B(0xFFFFFF);
res["PrimaryLightBrush"] = B(0xEEF2FF); res["InputBackgroundBrush"] = B(0xFFFFFF);
res["HeaderBrush"] = B(0xFFFFFF); res["BorderBrush"] = B(0xDDE0E6);
res["InputBackgroundBrush"] = B(0xF1F5F9); res["DividerBrush"] = B(0xECEEF2);
res["BadgeBrush"] = B(0xE0E7FF); res["HoverBrush"] = B(0xE6E8EE);
res["BadgeTextBrush"] = B(0x4338CA); res["SelectedBrush"] = B(0xE9E9FB);
res["TextPrimaryBrush"] = B(0x1B1D23);
res["TextSecondaryBrush"] = B(0x646A78);
res["TextTertiaryBrush"] = B(0x9AA0AC);
res["SidebarTextBrush"] = B(0x2A2D35);
res["SidebarSecondaryBrush"] = B(0x7A7F8C);
res["AccentSubtleBrush"] = B(0xE4E4FA);
res["AccentTextBrush"] = B(0x3F3FB5);
res["PrimaryLightBrush"] = res["AccentSubtleBrush"];
res["BadgeBrush"] = B(0xE8E8FB);
res["BadgeTextBrush"] = B(0x4343B8);
res["SnackbarBrush"] = B(0x2B2D35);
} }
} }
} }

View File

@@ -1,4 +1,4 @@
<Window x:Class="ReminderOrganizer.InputDialog" <Window x:Class="ReminderOrganizer.InputDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Input" Title="Input"
@@ -19,7 +19,7 @@
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/> <SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/>
</Window.Resources> </Window.Resources>
<Border CornerRadius="12" Background="{DynamicResource CardBrush}" Margin="8"> <Border CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="10">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.2" Direction="270" Color="Black"/> <DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.2" Direction="270" Color="Black"/>
</Border.Effect> </Border.Effect>
@@ -30,12 +30,11 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Header --> <!-- Header -->
<Border Grid.Row="0" Background="{DynamicResource PrimaryBrush}" CornerRadius="12,12,0,0" Padding="16,10"> <Border Grid.Row="0" Background="Transparent" CornerRadius="12,12,0,0" Padding="20,14,12,6">
<Grid> <Grid>
<TextBlock Text="&#xE8B7;" FontFamily="Segoe MDL2 Assets" FontSize="16" Foreground="White" VerticalAlignment="Center"/> <TextBlock Text="&#xE8B7;" FontFamily="Segoe MDL2 Assets" FontSize="16" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
<TextBlock x:Name="TxtTitle" FontSize="14" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="28,0,36,0"/> <TextBlock x:Name="TxtTitle" FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center" Margin="0,0,36,0"/>
<Button Content="&#xE8BB;" FontFamily="Segoe MDL2 Assets" FontSize="10" HorizontalAlignment="Right" Foreground="White" Background="Transparent" BorderThickness="0" <Button Content="&#xE8BB;" Style="{StaticResource IconButton}" FontSize="10" HorizontalAlignment="Right" Click="BtnCancel_Click" IsCancel="True"/>
Width="28" Height="28" Cursor="Hand" Click="BtnCancel_Click"/>
</Grid> </Grid>
</Border> </Border>

View File

@@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using ReminderOrganizer.Core; using ReminderOrganizer.Core;
@@ -13,6 +13,7 @@ namespace ReminderOrganizer
public InputDialog(string title, string prompt, string defaultValue = "", bool? darkMode = null) public InputDialog(string title, string prompt, string defaultValue = "", bool? darkMode = null)
{ {
InitializeComponent(); InitializeComponent();
DialogAnimation.Attach(this);
Title = title; Title = title;
TxtTitle.Text = title; TxtTitle.Text = title;
TxtPrompt.Text = prompt; TxtPrompt.Text = prompt;

View File

@@ -3,7 +3,7 @@
"File": "Datei", "File": "Datei",
"Exit": "Beenden", "Exit": "Beenden",
"Extras": "Extras", "Extras": "Extras",
"Autostart": "Autostart", "Autostart": "Mit Windows starten",
"Settings": "Einstellungen", "Settings": "Einstellungen",
"Language": "Sprache", "Language": "Sprache",
"German": "Deutsch", "German": "Deutsch",
@@ -67,8 +67,8 @@
"DeleteTaskTooltip": "Task löschen", "DeleteTaskTooltip": "Task löschen",
"Info": "Info", "Info": "Info",
"Discord": "Discord-Community", "Discord": "Discord-Community",
"Import": "Import", "Import": "Importieren",
"Export": "Export", "Export": "Exportieren",
"ImportCsv": "CSV Importieren", "ImportCsv": "CSV Importieren",
"ExportCsv": "CSV Exportieren", "ExportCsv": "CSV Exportieren",
"ImportSuccess": "{0} Tasks erfolgreich importiert!", "ImportSuccess": "{0} Tasks erfolgreich importiert!",
@@ -169,5 +169,29 @@
"Wedding50": "Goldene Hochzeit", "Wedding50": "Goldene Hochzeit",
"Wedding60": "Diamantene Hochzeit", "Wedding60": "Diamantene Hochzeit",
"Wedding65": "Eiserne Hochzeit", "Wedding65": "Eiserne Hochzeit",
"Wedding70": "Gnadenhochzeit" "Wedding70": "Gnadenhochzeit",
"NewEntry": "Neu",
"UpcomingBadgeTooltip": "Überfällig oder in den nächsten 7 Tagen",
"Restore": "Wiederherstellen",
"ThemeSystem": "System",
"SetAppearance": "Darstellung",
"SetTheme": "Farbschema",
"SetReminders": "Erinnerungen",
"PlaySoundHint": "Kurzer Ton, wenn eine Erinnerung erscheint.",
"AutostartHint": "Startet unsichtbar im Infobereich, damit keine Erinnerung verpasst wird.",
"TestNotificationHint": "Aussehen einer Erinnerung prüfen",
"CategoriesShort": "Arten von Jahrestagen mit eigenem Symbol, Farbe und Text.",
"EditCategoriesButton": "Bearbeiten…",
"SetData": "Daten",
"SetDataFolder": "Datenordner",
"OpenFolder": "Öffnen",
"SetCalendar": "Kalender (.ics)",
"SetCalendarHint": "Für Outlook, Google und Apple Kalender.",
"SetShortcuts": "Tastenkürzel",
"ShortcutSearch": "Suchen",
"ShortcutEdit": "Markierten Eintrag bearbeiten",
"ShortcutDelete": "Markierten Eintrag löschen",
"ShortcutEsc": "Suche / Auswahl aufheben",
"MovedToNext": "„{0}“ verschoben auf {1}",
"TestNow": "Test senden"
} }

View File

@@ -3,7 +3,7 @@
"File": "File", "File": "File",
"Exit": "Exit", "Exit": "Exit",
"Extras": "Extras", "Extras": "Extras",
"Autostart": "Autostart", "Autostart": "Start with Windows",
"Settings": "Settings", "Settings": "Settings",
"Language": "Language", "Language": "Language",
"German": "German", "German": "German",
@@ -65,7 +65,7 @@
"NextMonth": "Next Month", "NextMonth": "Next Month",
"EditTaskTooltip": "Edit task", "EditTaskTooltip": "Edit task",
"DeleteTaskTooltip": "Delete task", "DeleteTaskTooltip": "Delete task",
"Info": "Info", "Info": "About",
"Discord": "Discord community", "Discord": "Discord community",
"Import": "Import", "Import": "Import",
"Export": "Export", "Export": "Export",
@@ -169,5 +169,29 @@
"Wedding50": "Golden", "Wedding50": "Golden",
"Wedding60": "Diamond", "Wedding60": "Diamond",
"Wedding65": "Blue sapphire", "Wedding65": "Blue sapphire",
"Wedding70": "Platinum" "Wedding70": "Platinum",
"NewEntry": "New",
"UpcomingBadgeTooltip": "Overdue or due within 7 days",
"Restore": "Restore",
"ThemeSystem": "System",
"SetAppearance": "Appearance",
"SetTheme": "Theme",
"SetReminders": "Reminders",
"PlaySoundHint": "A short chime when a reminder is shown.",
"AutostartHint": "Starts hidden in the notification area so no reminder is missed.",
"TestNotificationHint": "Check how a reminder looks",
"CategoriesShort": "Kinds of yearly anniversaries with their own icon, color and text.",
"EditCategoriesButton": "Edit…",
"SetData": "Data",
"SetDataFolder": "Data folder",
"OpenFolder": "Open",
"SetCalendar": "Calendar (.ics)",
"SetCalendarHint": "For Outlook, Google and Apple Calendar.",
"SetShortcuts": "Keyboard shortcuts",
"ShortcutSearch": "Search",
"ShortcutEdit": "Edit selected entry",
"ShortcutDelete": "Delete selected entry",
"ShortcutEsc": "Clear search / selection",
"MovedToNext": "\"{0}\" moved to {1}",
"TestNow": "Send test"
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
#nullable enable #nullable enable
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
@@ -31,11 +32,13 @@ namespace ReminderOrganizer
?? throw new InvalidOperationException("MainViewModel not found"); ?? throw new InvalidOperationException("MainViewModel not found");
DataContext = _viewModel; DataContext = _viewModel;
_viewModel.ThemeChanged += (_, dark) => ApplyTheme(dark, animate: true); _viewModel.ThemeChanged += (_, dark) => Theme.Apply(Application.Current.Resources, dark);
_viewModel.EditTaskRequested += OnEditTaskRequested; _viewModel.EditTaskRequested += OnEditTaskRequested;
_viewModel.PropertyChanged += OnViewModelPropertyChanged; _viewModel.PropertyChanged += OnViewModelPropertyChanged;
Microsoft.Win32.SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
TrySetWindowIcon(); TrySetWindowIcon();
SourceInitialized += (_, _) => UseRoundedCorners();
Loaded += async (_, _) => await InitializeOnceAsync(); Loaded += async (_, _) => await InitializeOnceAsync();
StateChanged += MainWindow_StateChanged; StateChanged += MainWindow_StateChanged;
} }
@@ -53,17 +56,71 @@ namespace ReminderOrganizer
_initialized = true; _initialized = true;
SetupTrayIcon(); SetupTrayIcon();
await _viewModel.InitializeAsync(); await _viewModel.InitializeAsync();
ApplyTheme(_viewModel.IsDarkMode, animate: false); Theme.Apply(Application.Current.Resources, _viewModel.IsDarkMode);
RestoreWindowPlacement();
SyncTreeSelection(); SyncTreeSelection();
// The window starts invisible so the user never sees the default theme flash.
BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(160)));
} }
public void OnAppExit() public void OnAppExit()
{ {
if (!_initialized) return; if (!_initialized) return;
RememberWindowPlacement();
Microsoft.Win32.SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
_viewModel.Cleanup(); _viewModel.Cleanup();
_viewModel.FlushSave(); _viewModel.FlushSave();
} }
private void OnUserPreferenceChanged(object? sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
{
if (e.Category == Microsoft.Win32.UserPreferenceCategory.General)
Dispatcher.BeginInvoke(_viewModel.OnSystemThemeChanged);
}
// ---------- window placement ----------
private void RestoreWindowPlacement()
{
if (_viewModel.SavedWindowBounds is Rect r)
{
// only if the saved rectangle is still (mostly) on a screen
var screen = new Rect(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenTop,
SystemParameters.VirtualScreenWidth, SystemParameters.VirtualScreenHeight);
if (screen.IntersectsWith(new Rect(r.Left + 40, r.Top, Math.Max(1, r.Width - 80), 40)))
{
WindowStartupLocation = WindowStartupLocation.Manual;
Left = r.Left;
Top = r.Top;
Width = Math.Max(MinWidth, r.Width);
Height = Math.Max(MinHeight, r.Height);
}
}
if (_viewModel.SavedWindowMaximized) WindowState = WindowState.Maximized;
}
private void RememberWindowPlacement()
{
var bounds = WindowState == WindowState.Normal ? new Rect(Left, Top, Width, Height) : RestoreBounds;
if (bounds.Width > 0 && bounds.Height > 0)
_viewModel.RememberWindow(bounds, WindowState == WindowState.Maximized);
}
// Windows 11: native rounded corners for our custom-chrome window.
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int value, int size);
private void UseRoundedCorners()
{
try
{
int round = 2; // DWMWCP_ROUND
DwmSetWindowAttribute(new WindowInteropHelper(this).Handle, 33, ref round, sizeof(int));
}
catch { /* older Windows */ }
}
private void TrySetWindowIcon() private void TrySetWindowIcon()
{ {
try try
@@ -72,7 +129,7 @@ namespace ReminderOrganizer
} }
catch catch
{ {
// no Assets\app.ico yet – Windows default icon // no Assets\app.ico – Windows default icon
} }
} }
@@ -103,14 +160,10 @@ namespace ReminderOrganizer
}, System.Windows.Threading.DispatcherPriority.Loaded); }, System.Windows.Threading.DispatcherPriority.Loaded);
} }
private void UpcomingEntry_Click(object sender, MouseButtonEventArgs e)
{
_viewModel.ShowUpcomingCommand.Execute(null);
}
private void Window_PreviewKeyDown(object sender, KeyEventArgs e) private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
{ {
bool ctrl = (Keyboard.Modifiers & ModifierKeys.Control) != 0; bool ctrl = (Keyboard.Modifiers & ModifierKeys.Control) != 0;
bool typing = Keyboard.FocusedElement is TextBox;
if (ctrl && e.Key == Key.N) if (ctrl && e.Key == Key.N)
{ {
if (_viewModel.AddTaskCommand.CanExecute(null)) _viewModel.AddTaskCommand.Execute(null); if (_viewModel.AddTaskCommand.CanExecute(null)) _viewModel.AddTaskCommand.Execute(null);
@@ -122,23 +175,38 @@ namespace ReminderOrganizer
SearchBox.SelectAll(); SearchBox.SelectAll();
e.Handled = true; e.Handled = true;
} }
else if (ctrl && e.Key == Key.OemComma)
{
_viewModel.OpenSettingsCommand.Execute(null);
e.Handled = true;
}
else if (e.Key == Key.Escape && (SearchBox.IsKeyboardFocusWithin || _viewModel.SearchText.Length > 0)) else if (e.Key == Key.Escape && (SearchBox.IsKeyboardFocusWithin || _viewModel.SearchText.Length > 0))
{ {
_viewModel.ClearSearchCommand.Execute(null); _viewModel.ClearSearchCommand.Execute(null);
FolderTree.Focus(); FolderTree.Focus();
e.Handled = true; e.Handled = true;
} }
else if (ctrl && e.Key == Key.Z && _viewModel.IsUndoVisible) else if (e.Key == Key.Escape && _viewModel.SelectedTask != null)
{
_viewModel.SelectedTask = null;
e.Handled = true;
}
else if (ctrl && e.Key == Key.Z && _viewModel.IsUndoVisible && !typing)
{ {
_viewModel.UndoCommand.Execute(null); _viewModel.UndoCommand.Execute(null);
e.Handled = true; e.Handled = true;
} }
else if (e.Key == Key.Delete && !SearchBox.IsKeyboardFocusWithin && _viewModel.SelectedTask != null) else if (e.Key == Key.Delete && !typing && _viewModel.SelectedTask != null)
{ {
_viewModel.DeleteTaskCommand.Execute(_viewModel.SelectedTask); _viewModel.DeleteTaskCommand.Execute(_viewModel.SelectedTask);
_viewModel.SelectedTask = null; _viewModel.SelectedTask = null;
e.Handled = true; e.Handled = true;
} }
else if (e.Key == Key.Enter && !typing && _viewModel.SelectedTask != null)
{
_viewModel.EditTaskCommand.Execute(_viewModel.SelectedTask);
e.Handled = true;
}
} }
private void OnEditTaskRequested(object? sender, ReminderTask? task) private void OnEditTaskRequested(object? sender, ReminderTask? task)
@@ -152,29 +220,19 @@ namespace ReminderOrganizer
} }
} }
private void ApplyTheme(bool isDarkMode, bool animate) // ---------- caption ----------
{
Theme.Apply(Resources, isDarkMode);
if (!animate || ThemeTransitionOverlay == null) return;
var overlay = ThemeTransitionOverlay;
overlay.Background = new SolidColorBrush(isDarkMode ? Color.FromRgb(0x12, 0x12, 0x18) : Color.FromRgb(0xF1, 0xF5, 0xF9));
var fadeIn = new DoubleAnimation(0, 0.3, TimeSpan.FromMilliseconds(100));
var fadeOut = new DoubleAnimation(0.3, 0, TimeSpan.FromMilliseconds(200));
fadeIn.Completed += (s, args) => overlay.BeginAnimation(OpacityProperty, fadeOut);
overlay.BeginAnimation(OpacityProperty, fadeIn);
}
private void MainWindow_StateChanged(object? sender, EventArgs e) private void MainWindow_StateChanged(object? sender, EventArgs e)
{ {
if (WindowState == WindowState.Minimized) // With WindowChrome a maximized window reaches past the screen edge by the resize border.
{ RootGrid.Margin = WindowState == WindowState.Maximized ? new Thickness(7) : new Thickness(0);
HideToTray(); MaximizeButton.Content = WindowState == WindowState.Maximized ? "\uE923" : "\uE922";
} MaximizeButton.ToolTip = _viewModel.L(WindowState == WindowState.Maximized ? "Restore" : "Maximize");
} }
private void HideToTray() private void HideToTray()
{ {
RememberWindowPlacement();
Hide(); Hide();
if (!_trayHintShown && _notifyIcon != null) if (!_trayHintShown && _notifyIcon != null)
{ {
@@ -183,50 +241,30 @@ namespace ReminderOrganizer
} }
} }
private void TitleBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) private void MinimizeButton_Click(object sender, RoutedEventArgs e) => SystemCommands.MinimizeWindow(this);
{
if (e.ClickCount == 2)
{
MaximizeRestore();
}
else if (e.LeftButton == MouseButtonState.Pressed)
{
DragMove();
}
}
private void MinimizeButton_Click(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void MaximizeButton_Click(object sender, RoutedEventArgs e) private void MaximizeButton_Click(object sender, RoutedEventArgs e)
{ {
MaximizeRestore(); if (WindowState == WindowState.Maximized) SystemCommands.RestoreWindow(this);
else SystemCommands.MaximizeWindow(this);
} }
private void MaximizeRestore() /// <summary>The window's X keeps the app running in the tray (reminders need it); "Exit" is in the tray menu.</summary>
{ private void CloseButton_Click(object sender, RoutedEventArgs e) => HideToTray();
if (WindowState == WindowState.Maximized)
{
WindowState = WindowState.Normal;
MaximizeButton.Content = "";
}
else
{
// WindowStyle=None would cover the taskbar – limit to the work area.
MaxHeight = SystemParameters.WorkArea.Height + 8;
MaxWidth = SystemParameters.WorkArea.Width + 8;
WindowState = WindowState.Maximized;
MaximizeButton.Content = "";
}
}
private void CloseButton_Click(object sender, RoutedEventArgs e) protected override void OnClosing(CancelEventArgs e)
{ {
// Alt+F4 / taskbar "close window": same as the X button unless the app is shutting down.
if (!_shuttingDown)
{
e.Cancel = true;
HideToTray(); HideToTray();
} }
base.OnClosing(e);
}
private bool _shuttingDown;
public void AllowClose() => _shuttingDown = true;
private void SetupTrayIcon() private void SetupTrayIcon()
{ {
System.Drawing.Icon icon = System.Drawing.SystemIcons.Information; System.Drawing.Icon icon = System.Drawing.SystemIcons.Information;
@@ -250,8 +288,7 @@ namespace ReminderOrganizer
menu.Items.Add(_viewModel.L("Open"), null, (s, e) => ShowMainWindow()); menu.Items.Add(_viewModel.L("Open"), null, (s, e) => ShowMainWindow());
menu.Items.Add(_viewModel.L("Exit"), null, (s, e) => menu.Items.Add(_viewModel.L("Exit"), null, (s, e) =>
{ {
_viewModel.Cleanup(); App.Quit();
Application.Current.Shutdown();
}); });
_notifyIcon.ContextMenuStrip = menu; _notifyIcon.ContextMenuStrip = menu;
_notifyIcon.DoubleClick += (s, e) => ShowMainWindow(); _notifyIcon.DoubleClick += (s, e) => ShowMainWindow();
@@ -327,42 +364,6 @@ namespace ReminderOrganizer
} }
} }
private void TaskItem_MouseEnter(object sender, MouseEventArgs e)
{
if (sender is Border border)
{
if (border.RenderTransform is ScaleTransform scaleTransform)
{
scaleTransform.BeginAnimation(ScaleTransform.ScaleXProperty, new DoubleAnimation(1, 1.01, TimeSpan.FromMilliseconds(150)));
scaleTransform.BeginAnimation(ScaleTransform.ScaleYProperty, new DoubleAnimation(1, 1.01, TimeSpan.FromMilliseconds(150)));
}
if (border.Effect is System.Windows.Media.Effects.DropShadowEffect effect)
{
effect.BeginAnimation(System.Windows.Media.Effects.DropShadowEffect.BlurRadiusProperty, new DoubleAnimation(15, TimeSpan.FromMilliseconds(200)));
effect.BeginAnimation(System.Windows.Media.Effects.DropShadowEffect.OpacityProperty, new DoubleAnimation(0.35, TimeSpan.FromMilliseconds(200)));
}
border.SetResourceReference(Border.BackgroundProperty, "HoverBrush");
}
}
private void TaskItem_MouseLeave(object sender, MouseEventArgs e)
{
if (sender is Border border)
{
if (border.RenderTransform is ScaleTransform scaleTransform)
{
scaleTransform.BeginAnimation(ScaleTransform.ScaleXProperty, new DoubleAnimation(1, TimeSpan.FromMilliseconds(150)));
scaleTransform.BeginAnimation(ScaleTransform.ScaleYProperty, new DoubleAnimation(1, TimeSpan.FromMilliseconds(150)));
}
if (border.Effect is System.Windows.Media.Effects.DropShadowEffect effect)
{
effect.BeginAnimation(System.Windows.Media.Effects.DropShadowEffect.BlurRadiusProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(150)));
effect.BeginAnimation(System.Windows.Media.Effects.DropShadowEffect.OpacityProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(150)));
}
border.Background = Brushes.Transparent;
}
}
private void TaskItem_MouseMove(object sender, MouseEventArgs e) private void TaskItem_MouseMove(object sender, MouseEventArgs e)
{ {
if (e.LeftButton != MouseButtonState.Pressed || sender is not FrameworkElement element || element.DataContext is not ReminderTask task) if (e.LeftButton != MouseButtonState.Pressed || sender is not FrameworkElement element || element.DataContext is not ReminderTask task)
@@ -376,17 +377,6 @@ namespace ReminderOrganizer
DragDrop.DoDragDrop(element, task, DragDropEffects.Move); DragDrop.DoDragDrop(element, task, DragDropEffects.Move);
} }
// kept for styles that still reference them
private void SecondaryButton_MouseEnter(object sender, MouseEventArgs e)
{
if (sender is Border border) border.SetResourceReference(Border.BackgroundProperty, "HoverBrush");
}
private void SecondaryButton_MouseLeave(object sender, MouseEventArgs e)
{
if (sender is Border border) border.Background = Brushes.Transparent;
}
private void TreeView_DragOver(object sender, DragEventArgs e) private void TreeView_DragOver(object sender, DragEventArgs e)
{ {
e.Effects = e.Data.GetDataPresent(typeof(ReminderTask)) ? DragDropEffects.Move : DragDropEffects.None; e.Effects = e.Data.GetDataPresent(typeof(ReminderTask)) ? DragDropEffects.Move : DragDropEffects.None;

View File

@@ -138,6 +138,11 @@ namespace ReminderOrganizer.Models
/// <summary>Set once by the app: culture for month names, relative-date formatter.</summary> /// <summary>Set once by the app: culture for month names, relative-date formatter.</summary>
public static Func<CultureInfo>? DisplayCulture { get; set; } public static Func<CultureInfo>? DisplayCulture { get; set; }
public static Func<DateTime, DateTime, string>? RelativeFormatter { get; set; } public static Func<DateTime, DateTime, string>? RelativeFormatter { get; set; }
public static Func<RecurrenceType, string>? RecurrenceFormatter { get; set; }
/// <summary>"Weekly" etc. for recurring appointments (empty for one-off tasks and anniversaries).</summary>
[System.Text.Json.Serialization.JsonIgnore]
public string RecurrenceText => IsRecurring && !IsAnniversary ? RecurrenceFormatter?.Invoke(RecurrenceType) ?? RecurrenceType.ToString() : "";
/// <summary>"19. März" for birthdays, otherwise "19.03.2027 09:00".</summary> /// <summary>"19. März" for birthdays, otherwise "19.03.2027 09:00".</summary>
[System.Text.Json.Serialization.JsonIgnore] [System.Text.Json.Serialization.JsonIgnore]
@@ -329,6 +334,16 @@ namespace ReminderOrganizer.Models
public bool? IsDarkMode { get; set; } public bool? IsDarkMode { get; set; }
public bool PlaySound { get; set; } = true; public bool PlaySound { get; set; } = true;
public bool HideDone { get; set; } public bool HideDone { get; set; }
/// <summary>"system", "light", "dark" (empty = from IsDarkMode of older files).</summary>
public string ThemeMode { get; set; } = "";
/// <summary>Last window position/size (device-independent pixels).</summary>
public double? WindowLeft { get; set; }
public double? WindowTop { get; set; }
public double? WindowWidth { get; set; }
public double? WindowHeight { get; set; }
public bool WindowMaximized { get; set; }
/// <summary>"list", "compact" or "cards".</summary> /// <summary>"list", "compact" or "cards".</summary>
public string ViewMode { get; set; } = "list"; public string ViewMode { get; set; } = "list";
/// <summary>Group the list by month (collapsible).</summary> /// <summary>Group the list by month (collapsible).</summary>

236
SettingsWindow.xaml Normal file
View File

@@ -0,0 +1,236 @@
<Window x:Class="ReminderOrganizer.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding [Settings]}"
Width="620" Height="680"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False"
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
FontFamily="{StaticResource UiFont}" FontSize="13" Foreground="{DynamicResource TextPrimaryBrush}"
UseLayoutRounding="True"
MouseLeftButtonDown="Window_MouseLeftButtonDown" KeyDown="Window_KeyDown">
<Window.Resources>
<!-- one settings group -->
<Style x:Key="Group" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource DividerBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Margin" Value="0,0,0,18"/>
</Style>
<Style x:Key="GroupTitle" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="2,0,0,8"/>
</Style>
<!-- one row inside a group: label left, control right -->
<Style x:Key="Row" TargetType="DockPanel">
<Setter Property="Margin" Value="16,12"/>
<Setter Property="LastChildFill" Value="False"/>
</Style>
<Style x:Key="RowLabel" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="DockPanel.Dock" Value="Left"/>
</Style>
<Style x:Key="RowHint" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="0,2,0,0"/>
</Style>
<Style x:Key="Divider" TargetType="Border">
<Setter Property="Height" Value="1"/>
<Setter Property="Background" Value="{DynamicResource DividerBrush}"/>
</Style>
<Style x:Key="Key" TargetType="Border">
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Background" Value="{DynamicResource CardBrush}"/>
<Setter Property="Padding" Value="6,1"/>
<Setter Property="Margin" Value="0,0,4,0"/>
</Style>
</Window.Resources>
<Border Margin="10" CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="24" ShadowDepth="6" Opacity="0.28" Direction="270" Color="Black"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- header -->
<DockPanel Margin="24,18,14,8">
<Button DockPanel.Dock="Right" Content="&#xE8BB;" Style="{StaticResource IconButton}" FontSize="10" Click="Close_Click" ToolTip="Esc"/>
<TextBlock Text="{Binding [Settings]}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
</DockPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Padding="24,8,20,20">
<StackPanel>
<!-- appearance -->
<TextBlock Text="{Binding [SetAppearance]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}">
<StackPanel>
<DockPanel Style="{StaticResource Row}">
<TextBlock Text="{Binding [SetTheme]}" Style="{StaticResource RowLabel}"/>
<Border DockPanel.Dock="Right" Style="{StaticResource SegmentHost}">
<StackPanel Orientation="Horizontal">
<RadioButton GroupName="theme" Content="{Binding [ThemeSystem]}" IsChecked="{Binding IsThemeSystem}" Style="{StaticResource Segment}"/>
<RadioButton GroupName="theme" Content="{Binding [LightMode]}" IsChecked="{Binding IsThemeLight}" Style="{StaticResource Segment}"/>
<RadioButton GroupName="theme" Content="{Binding [DarkMode]}" IsChecked="{Binding IsThemeDark}" Style="{StaticResource Segment}"/>
</StackPanel>
</Border>
</DockPanel>
<Border Style="{StaticResource Divider}"/>
<DockPanel Style="{StaticResource Row}">
<TextBlock Text="{Binding [Language]}" Style="{StaticResource RowLabel}"/>
<Border DockPanel.Dock="Right" Style="{StaticResource SegmentHost}">
<StackPanel Orientation="Horizontal">
<RadioButton GroupName="lang" Content="Deutsch" IsChecked="{Binding IsGerman}" Style="{StaticResource Segment}"/>
<RadioButton GroupName="lang" Content="English" IsChecked="{Binding IsEnglish}" Style="{StaticResource Segment}"/>
</StackPanel>
</Border>
</DockPanel>
</StackPanel>
</Border>
<!-- reminders -->
<TextBlock Text="{Binding [SetReminders]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}">
<StackPanel>
<DockPanel Style="{StaticResource Row}">
<StackPanel DockPanel.Dock="Left" MaxWidth="360">
<TextBlock Text="{Binding [PlaySound]}"/>
<TextBlock Text="{Binding [PlaySoundHint]}" Style="{StaticResource RowHint}"/>
</StackPanel>
<CheckBox DockPanel.Dock="Right" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding PlaySound}" VerticalAlignment="Center"/>
</DockPanel>
<Border Style="{StaticResource Divider}"/>
<DockPanel Style="{StaticResource Row}">
<StackPanel DockPanel.Dock="Left" MaxWidth="360">
<TextBlock Text="{Binding [Autostart]}"/>
<TextBlock Text="{Binding [AutostartHint]}" Style="{StaticResource RowHint}"/>
</StackPanel>
<CheckBox DockPanel.Dock="Right" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding IsAutostartEnabled}" VerticalAlignment="Center"/>
</DockPanel>
<Border Style="{StaticResource Divider}"/>
<DockPanel Style="{StaticResource Row}">
<TextBlock Text="{Binding [TestNotificationHint]}" Style="{StaticResource RowLabel}"/>
<Button DockPanel.Dock="Right" Content="{Binding [TestNow]}" Style="{StaticResource SubtleButton}" Command="{Binding TestNotificationCommand}"/>
</DockPanel>
</StackPanel>
</Border>
<!-- categories -->
<TextBlock Text="{Binding [Categories]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}">
<DockPanel Style="{StaticResource Row}">
<StackPanel DockPanel.Dock="Left" MaxWidth="360">
<TextBlock Text="{Binding [CategoriesShort]}" TextWrapping="Wrap"/>
<ItemsControl ItemsSource="{Binding Categories}" Margin="0,8,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border CornerRadius="10" Padding="8,2" Margin="0,0,6,6" Background="{Binding Color, Converter={StaticResource HexToBrush}, ConverterParameter=0.14}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Glyph}" FontFamily="{StaticResource IconFont}" FontSize="11" VerticalAlignment="Center"
Foreground="{Binding Color, Converter={StaticResource HexToBrush}}"/>
<TextBlock Text="{Binding Name}" FontSize="12" Margin="6,0,0,0"/>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<Button DockPanel.Dock="Right" Content="{Binding [EditCategoriesButton]}" Style="{StaticResource SubtleButton}"
Command="{Binding EditCategoriesCommand}" VerticalAlignment="Top"/>
</DockPanel>
</Border>
<!-- data -->
<TextBlock Text="{Binding [SetData]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}">
<StackPanel>
<DockPanel Style="{StaticResource Row}">
<StackPanel DockPanel.Dock="Left" MaxWidth="330">
<TextBlock Text="{Binding [SetDataFolder]}"/>
<TextBlock Text="{Binding DataFolder}" Style="{StaticResource RowHint}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"
ToolTip="{Binding DataFolder}"/>
</StackPanel>
<Button DockPanel.Dock="Right" Content="{Binding [OpenFolder]}" Style="{StaticResource SubtleButton}" Command="{Binding OpenDataFolderCommand}"/>
</DockPanel>
<Border Style="{StaticResource Divider}"/>
<DockPanel Style="{StaticResource Row}">
<TextBlock Text="CSV" Style="{StaticResource RowLabel}"/>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<Button Content="{Binding [Import]}" Style="{StaticResource SubtleButton}" Command="{Binding ImportCsvCommand}" Margin="0,0,8,0"/>
<Button Content="{Binding [Export]}" Style="{StaticResource SubtleButton}" Command="{Binding ExportCsvCommand}"/>
</StackPanel>
</DockPanel>
<Border Style="{StaticResource Divider}"/>
<DockPanel Style="{StaticResource Row}">
<StackPanel DockPanel.Dock="Left" MaxWidth="330">
<TextBlock Text="{Binding [SetCalendar]}"/>
<TextBlock Text="{Binding [SetCalendarHint]}" Style="{StaticResource RowHint}"/>
</StackPanel>
<Button DockPanel.Dock="Right" Content="{Binding [Export]}" Style="{StaticResource SubtleButton}" Command="{Binding ExportIcsCommand}"/>
</DockPanel>
</StackPanel>
</Border>
<!-- shortcuts -->
<TextBlock Text="{Binding [SetShortcuts]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}" Padding="16,10">
<Grid TextElement.FontSize="12.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Ctrl"/></Border><Border Style="{StaticResource Key}"><TextBlock Text="N"/></Border></StackPanel>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding [NewEntry]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Ctrl"/></Border><Border Style="{StaticResource Key}"><TextBlock Text="F"/></Border></StackPanel>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding [ShortcutSearch]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Enter"/></Border></StackPanel>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding [ShortcutEdit]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Entf / Del"/></Border></StackPanel>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding [ShortcutDelete]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="4" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Ctrl"/></Border><Border Style="{StaticResource Key}"><TextBlock Text="Z"/></Border></StackPanel>
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding [Undo]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="5" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Esc"/></Border></StackPanel>
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding [ShortcutEsc]}" VerticalAlignment="Center"/>
<StackPanel Grid.Row="6" Orientation="Horizontal" Margin="0,3"><Border Style="{StaticResource Key}"><TextBlock Text="Ctrl"/></Border><Border Style="{StaticResource Key}"><TextBlock Text=","/></Border></StackPanel>
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding [Settings]}" VerticalAlignment="Center"/>
</Grid>
</Border>
<!-- about -->
<TextBlock Text="{Binding [Info]}" Style="{StaticResource GroupTitle}"/>
<Border Style="{StaticResource Group}" Margin="0">
<DockPanel Margin="16,14">
<Image DockPanel.Dock="Left" Source="/Assets/app.png" Width="40" Height="40" Margin="0,0,14,0" RenderOptions.BitmapScalingMode="HighQuality"/>
<StackPanel VerticalAlignment="Center">
<TextBlock FontWeight="SemiBold">
<Run Text="{Binding [AppTitle], Mode=OneWay}"/>
<Run Text="{Binding VersionText, Mode=OneWay}" FontWeight="Normal" Foreground="{DynamicResource TextSecondaryBrush}"/>
</TextBlock>
<TextBlock FontSize="12" Margin="0,2,0,0" Foreground="{DynamicResource TextSecondaryBrush}">
<Run Text="{Binding CopyrightText, Mode=OneWay}"/>
<Run Text=" · "/>
<Hyperlink Command="{Binding OpenDiscordCommand}" Foreground="{DynamicResource PrimaryBrush}" TextDecorations="None">discord.gg/Ej4JPmCZva</Hyperlink>
</TextBlock>
</StackPanel>
</DockPanel>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</Border>
</Window>

31
SettingsWindow.xaml.cs Normal file
View File

@@ -0,0 +1,31 @@
#nullable enable
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using ReminderOrganizer.ViewModels;
namespace ReminderOrganizer
{
/// <summary>All settings in one place (replaces the old File/View menu). Changes apply immediately.</summary>
public partial class SettingsWindow : Window
{
public SettingsWindow(MainViewModel viewModel)
{
InitializeComponent();
DataContext = viewModel;
DialogAnimation.Attach(this);
}
private void Close_Click(object sender, RoutedEventArgs e) => Close();
private void Window_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape) Close();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed && e.OriginalSource is not TextBox) DragMove();
}
}
}

View File

@@ -20,26 +20,7 @@
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/> <SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/>
<SolidColorBrush x:Key="HoverBrush" Color="#E2E8F0"/> <SolidColorBrush x:Key="HoverBrush" Color="#E2E8F0"/>
<Style x:Key="Segment" TargetType="RadioButton">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border x:Name="bd" CornerRadius="6" Padding="14,6" Background="Transparent">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="bd" Property="Background" Value="{DynamicResource PrimaryBrush}"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Label" TargetType="TextBlock"> <Style x:Key="Label" TargetType="TextBlock">
<Setter Property="FontSize" Value="11"/> <Setter Property="FontSize" Value="11"/>
@@ -110,7 +91,7 @@
</Style> </Style>
</Window.Resources> </Window.Resources>
<Border CornerRadius="12" Background="{DynamicResource CardBrush}" Margin="8"> <Border CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="10">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/> <DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/>
</Border.Effect> </Border.Effect>
@@ -121,21 +102,19 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Header --> <!-- Header -->
<Border Grid.Row="0" Background="{DynamicResource PrimaryBrush}" CornerRadius="12,12,0,0" Padding="16,10"> <Border Grid.Row="0" Background="Transparent" CornerRadius="12,12,0,0" Padding="20,14,12,6">
<Grid> <Grid>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="&#xEA8F;" FontFamily="Segoe MDL2 Assets" FontSize="15" Foreground="White" VerticalAlignment="Center"/> <TextBlock Text="{Binding WindowTitle}" FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding WindowTitle}" FontSize="14" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel> </StackPanel>
<Button Content="&#xE8BB;" FontFamily="Segoe MDL2 Assets" FontSize="10" HorizontalAlignment="Right" Foreground="White" Background="Transparent" BorderThickness="0" <Button Content="&#xE8BB;" Style="{StaticResource IconButton}" FontSize="10" HorizontalAlignment="Right" Command="{Binding CancelCommand}" IsCancel="True"/>
Width="28" Height="28" Cursor="Hand" Command="{Binding CancelCommand}" IsCancel="True"/>
</Grid> </Grid>
</Border> </Border>
<!-- Content --> <!-- Content -->
<StackPanel Grid.Row="1" Margin="18,16,18,18"> <StackPanel Grid.Row="1" Margin="18,16,18,18">
<!-- Type: appointment / birthday --> <!-- Type: appointment / birthday -->
<Border CornerRadius="8" Background="{DynamicResource InputBackgroundBrush}" Padding="3" Margin="0,0,0,14" HorizontalAlignment="Left"> <Border Style="{StaticResource SegmentHost}" Margin="0,0,0,14" HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<RadioButton GroupName="type" IsChecked="{Binding IsAppointment}" Style="{StaticResource Segment}"> <RadioButton GroupName="type" IsChecked="{Binding IsAppointment}" Style="{StaticResource Segment}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">

View File

@@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using ReminderOrganizer.Core; using ReminderOrganizer.Core;
@@ -19,6 +19,7 @@ namespace ReminderOrganizer
System.Collections.Generic.IEnumerable<Category> categories, string? defaultCategory = null) System.Collections.Generic.IEnumerable<Category> categories, string? defaultCategory = null)
{ {
InitializeComponent(); InitializeComponent();
DialogAnimation.Attach(this);
Theme.Apply(Resources, darkMode); Theme.Apply(Resources, darkMode);
var localizationService = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!; var localizationService = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!;

690
Themes/Controls.xaml Normal file
View File

@@ -0,0 +1,690 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Shared control styles. Colors are DynamicResources set by Core/Theme.cs on Application.Resources,
so everything (also context menus, tooltips, dialogs) follows light/dark.
Design rules: neutral greys, one accent, 4/8 px spacing, 6–10 px radii, no glow, no scaling on hover.
-->
<FontFamily x:Key="UiFont">Segoe UI Variable Text, Segoe UI</FontFamily>
<FontFamily x:Key="IconFont">Segoe Fluent Icons, Segoe MDL2 Assets</FontFamily>
<!-- defaults until Theme.Apply runs (dark) -->
<SolidColorBrush x:Key="PrimaryBrush" Color="#5B5BD6"/>
<SolidColorBrush x:Key="PrimaryHoverBrush" Color="#4C4CC4"/>
<SolidColorBrush x:Key="DangerBrush" Color="#F0706A"/>
<SolidColorBrush x:Key="WarningBrush" Color="#E5A00D"/>
<SolidColorBrush x:Key="SuccessBrush" Color="#3DD68C"/>
<SolidColorBrush x:Key="SecondaryBrush" Color="#3DD68C"/>
<SolidColorBrush x:Key="BackgroundBrush" Color="#16161A"/>
<SolidColorBrush x:Key="SidebarBrush" Color="#1C1C21"/>
<SolidColorBrush x:Key="HeaderBrush" Color="#1C1C21"/>
<SolidColorBrush x:Key="CardBrush" Color="#202026"/>
<SolidColorBrush x:Key="MenuBackgroundBrush" Color="#26262D"/>
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#1A1A1F"/>
<SolidColorBrush x:Key="BorderBrush" Color="#2E2E36"/>
<SolidColorBrush x:Key="DividerBrush" Color="#2A2A31"/>
<SolidColorBrush x:Key="HoverBrush" Color="#2A2A31"/>
<SolidColorBrush x:Key="SelectedBrush" Color="#2B2B45"/>
<SolidColorBrush x:Key="TextPrimaryBrush" Color="#EDEDF2"/>
<SolidColorBrush x:Key="TextSecondaryBrush" Color="#9C9CA8"/>
<SolidColorBrush x:Key="TextTertiaryBrush" Color="#6E6E7A"/>
<SolidColorBrush x:Key="SidebarTextBrush" Color="#DCDCE4"/>
<SolidColorBrush x:Key="SidebarSecondaryBrush" Color="#80808C"/>
<SolidColorBrush x:Key="AccentSubtleBrush" Color="#2D2D4C"/>
<SolidColorBrush x:Key="AccentTextBrush" Color="#B9BAFF"/>
<SolidColorBrush x:Key="PrimaryLightBrush" Color="#2D2D4C"/>
<SolidColorBrush x:Key="BadgeBrush" Color="#2D2D4C"/>
<SolidColorBrush x:Key="BadgeTextBrush" Color="#B9BAFF"/>
<SolidColorBrush x:Key="SnackbarBrush" Color="#33333C"/>
<Geometry x:Key="FolderGeometry">M1.5,3.5 L6,3.5 L7.5,5 L14.5,5 L14.5,13.5 L1.5,13.5 Z</Geometry>
<!-- ========== scrolling ========== -->
<Style TargetType="ScrollBar">
<Setter Property="Width" Value="10"/>
<Setter Property="MinWidth" Value="10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid Background="Transparent">
<Track x:Name="PART_Track" IsDirectionReversed="True">
<Track.Thumb>
<Thumb>
<Thumb.Template>
<ControlTemplate TargetType="Thumb">
<Border x:Name="t" Background="{DynamicResource TextTertiaryBrush}" Opacity="0.45"
CornerRadius="3" Width="6" Margin="0,2"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="t" Property="Opacity" Value="0.8"/>
</Trigger>
<Trigger Property="IsDragging" Value="True">
<Setter TargetName="t" Property="Opacity" Value="0.9"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="10"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- ========== tooltip ========== -->
<Style TargetType="ToolTip">
<Setter Property="Background" Value="{DynamicResource MenuBackgroundBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"
CornerRadius="6" Padding="8,5" Margin="4" SnapsToDevicePixels="True">
<Border.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="1" Opacity="0.18" Color="Black"/>
</Border.Effect>
<ContentPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== menus (top menu + context menus) ========== -->
<Style TargetType="Menu">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
</Style>
<Style TargetType="ContextMenu">
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{DynamicResource MenuBackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
CornerRadius="8" Padding="4" Margin="6">
<Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="3" Opacity="0.22" Color="Black"/>
</Border.Effect>
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Separator">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Separator">
<Border Height="1" Margin="6,4" Background="{DynamicResource DividerBrush}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Separator">
<Border Height="1" Margin="6,4" Background="{DynamicResource DividerBrush}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="MenuItem">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Bd" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="5" MinWidth="40">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="IconCol" Width="26"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="Icon" ContentSource="Icon" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock x:Name="Check" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="12" VerticalAlignment="Center"
Foreground="{DynamicResource PrimaryBrush}" Visibility="Collapsed"/>
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center"/>
<TextBlock Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="24,0,0,0" FontSize="12"
Foreground="{DynamicResource TextTertiaryBrush}" VerticalAlignment="Center"/>
<TextBlock x:Name="Arrow" Grid.Column="3" Text="&#xE76C;" FontFamily="{StaticResource IconFont}" FontSize="9"
Margin="12,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource TextSecondaryBrush}" Visibility="Collapsed"/>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Right" HorizontalOffset="-2" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border Background="{DynamicResource MenuBackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
CornerRadius="8" Padding="4" Margin="6" MinWidth="180">
<Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="3" Opacity="0.22" Color="Black"/>
</Border.Effect>
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Role" Value="TopLevelHeader">
<Setter TargetName="PART_Popup" Property="Placement" Value="Bottom"/>
<Setter TargetName="PART_Popup" Property="HorizontalOffset" Value="-6"/>
<Setter TargetName="IconCol" Property="Width" Value="0"/>
<Setter Property="Padding" Value="10,5"/>
</Trigger>
<Trigger Property="Role" Value="SubmenuHeader">
<Setter TargetName="Arrow" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Check" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
<Trigger Property="IsSubmenuOpen" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextTertiaryBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== buttons ========== -->
<Style x:Key="PrimaryButton" TargetType="Button">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="14,7"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Opacity" Value="0.85"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SubtleButton" TargetType="Button">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="14,7"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"
CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- small square icon button (glyph as Content) -->
<Style x:Key="IconButton" TargetType="Button">
<Setter Property="FontFamily" Value="{StaticResource IconFont}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="28"/>
<Setter Property="Height" Value="28"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.35"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- window caption buttons (46 px wide like Windows) -->
<Style x:Key="CaptionButton" TargetType="Button">
<Setter Property="FontFamily" Value="{StaticResource IconFont}"/>
<Setter Property="FontSize" Value="10"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Width" Value="46"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="Transparent">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CloseCaptionButton" TargetType="Button" BasedOn="{StaticResource CaptionButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="Transparent">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#C42B1C"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== segmented control (radio buttons in a shared container) ========== -->
<Style x:Key="Segment" TargetType="RadioButton">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="12.5"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Padding" Value="12,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border x:Name="Bd" CornerRadius="5" Padding="{TemplateBinding Padding}" Background="Transparent" MinHeight="26">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource CardBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter TargetName="Bd" Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="4" ShadowDepth="1" Opacity="0.15" Color="Black"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="IconSegment" TargetType="RadioButton" BasedOn="{StaticResource Segment}">
<Setter Property="FontFamily" Value="{StaticResource IconFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="8,4"/>
</Style>
<Style x:Key="SegmentHost" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource HoverBrush}"/>
<Setter Property="CornerRadius" Value="7"/>
<Setter Property="Padding" Value="2"/>
</Style>
<!-- toggle button with icon, same look as a segment (used for "group by month") -->
<Style x:Key="IconToggle" TargetType="ToggleButton">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontFamily" Value="{StaticResource IconFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" CornerRadius="5" Padding="8,4" Background="Transparent" MinHeight="26">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource CardBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
<Setter TargetName="Bd" Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="4" ShadowDepth="1" Opacity="0.15" Color="Black"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== toggle switch ========== -->
<Style x:Key="ToggleSwitch" TargetType="CheckBox">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="12.5"/>
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal" Background="Transparent">
<Border x:Name="Track" Width="32" Height="18" CornerRadius="9" BorderThickness="1"
BorderBrush="{DynamicResource TextTertiaryBrush}" Background="Transparent">
<Ellipse x:Name="Knob" Width="10" Height="10" Fill="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Left" Margin="3,0">
<Ellipse.RenderTransform>
<TranslateTransform x:Name="KnobX" X="0"/>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
<ContentPresenter Margin="8,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Track" Property="Background" Value="{DynamicResource PrimaryBrush}"/>
<Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
<Setter TargetName="Knob" Property="Fill" Value="White"/>
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="KnobX" Storyboard.TargetProperty="X" To="14" Duration="0:0:0.12">
<DoubleAnimation.EasingFunction><CubicEase EasingMode="EaseOut"/></DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="KnobX" Storyboard.TargetProperty="X" To="0" Duration="0:0:0.12">
<DoubleAnimation.EasingFunction><CubicEase EasingMode="EaseOut"/></DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== round "done" check (To-Do style) ========== -->
<Style x:Key="DoneCheck" TargetType="CheckBox">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Grid Background="Transparent" Width="22" Height="22">
<Ellipse x:Name="Ring" Width="18" Height="18" StrokeThickness="1.5" Stroke="{DynamicResource TextTertiaryBrush}" Fill="Transparent"/>
<TextBlock x:Name="Mark" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="10"
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource TextSecondaryBrush}" Opacity="0"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Ring" Property="Stroke" Value="{DynamicResource SuccessBrush}"/>
<Setter TargetName="Mark" Property="Opacity" Value="0.7"/>
<Setter TargetName="Mark" Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Ring" Property="Fill" Value="{DynamicResource SuccessBrush}"/>
<Setter TargetName="Ring" Property="Stroke" Value="{DynamicResource SuccessBrush}"/>
<Setter TargetName="Mark" Property="Opacity" Value="1"/>
<Setter TargetName="Mark" Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- row action icon (edit/delete), hidden until the row is hovered or selected -->
<Style x:Key="RowIcon" TargetType="Button" BasedOn="{StaticResource IconButton}">
<Setter Property="Width" Value="26"/>
<Setter Property="Height" Value="26"/>
<Setter Property="CommandParameter" Value="{Binding}"/>
</Style>
<!-- ========== text inputs ========== -->
<Style x:Key="SearchBox" TargetType="TextBox">
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="CaretBrush" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<!-- ========== combo box (all dialogs) ========== -->
<Style TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Bd" Background="Transparent" CornerRadius="5" Padding="{TemplateBinding Padding}" Margin="0,1">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource AccentSubtleBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Background" Value="{DynamicResource InputBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton x:Name="Toggle" Focusable="False" ClickMode="Press"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" CornerRadius="6" BorderThickness="1"
Background="{Binding Background, RelativeSource={RelativeSource AncestorType=ComboBox}}"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=ComboBox}}">
<TextBlock Text="&#xE70D;" FontFamily="{StaticResource IconFont}" FontSize="10" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,0,10,0" Foreground="{DynamicResource TextSecondaryBrush}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource TextTertiaryBrush}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<ContentPresenter Margin="11,0,30,0" VerticalAlignment="Center" HorizontalAlignment="Left" IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
<Popup x:Name="PART_Popup" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" AllowsTransparency="True"
Focusable="False" PopupAnimation="Fade" VerticalOffset="2">
<Border Background="{DynamicResource MenuBackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
CornerRadius="8" Padding="4" Margin="6,0,6,8"
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" MaxHeight="320">
<Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="3" Opacity="0.22" Color="Black"/>
</Border.Effect>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== date picker (text field + calendar button) ========== -->
<Style TargetType="DatePickerTextBox">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="CaretBrush" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DatePickerTextBox">
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center" Margin="10,0,0,0"
HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="DatePicker">
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DatePicker">
<Border x:Name="Bd" CornerRadius="6" BorderThickness="1"
Background="{DynamicResource InputBackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}">
<Grid x:Name="PART_Root">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<DatePickerTextBox x:Name="PART_TextBox" Grid.Column="0"/>
<Button x:Name="PART_Button" Grid.Column="1" Content="&#xE787;" Style="{StaticResource IconButton}"
Width="28" Height="26" Margin="0,0,3,0" Focusable="False"/>
<Popup x:Name="PART_Popup" PlacementTarget="{Binding ElementName=PART_TextBox}" Placement="Bottom"
StaysOpen="False" AllowsTransparency="True"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource TextTertiaryBrush}"/>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ========== check box (default look) ========== -->
<Style TargetType="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
<Setter Property="FontFamily" Value="{StaticResource UiFont}"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal" Background="Transparent">
<Border x:Name="Box" Width="18" Height="18" CornerRadius="4" BorderThickness="1.5" VerticalAlignment="Center"
BorderBrush="{DynamicResource TextTertiaryBrush}" Background="Transparent">
<TextBlock x:Name="Mark" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="11" Foreground="White"
HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
</Border>
<ContentPresenter Margin="8,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Box" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Box" Property="Background" Value="{DynamicResource PrimaryBrush}"/>
<Setter TargetName="Box" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
<Setter TargetName="Mark" Property="Visibility" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SectionLabel" TargetType="TextBlock">
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="{DynamicResource SidebarSecondaryBrush}"/>
</Style>
</ResourceDictionary>

View File

@@ -167,9 +167,77 @@ namespace ReminderOrganizer.ViewModels
// ---------- settings ---------- // ---------- settings ----------
public bool IsGerman => _localizationService.CurrentLanguage == "de"; public bool IsGerman
public bool IsEnglish => _localizationService.CurrentLanguage == "en"; {
public bool IsAutostartEnabled => _autostartService.IsAutostartEnabled; get => _localizationService.CurrentLanguage == "de";
set { if (value) _localizationService.SetLanguage("de"); }
}
public bool IsEnglish
{
get => _localizationService.CurrentLanguage == "en";
set { if (value) _localizationService.SetLanguage("en"); }
}
public bool IsAutostartEnabled
{
get => _autostartService.IsAutostartEnabled;
set { if (value != _autostartService.IsAutostartEnabled) ToggleAutostart(); }
}
// ---------- theme: system / light / dark ----------
/// <summary>"system", "light" or "dark".</summary>
public string ThemeMode
{
get => string.IsNullOrEmpty(_appData.ThemeMode) ? "system" : _appData.ThemeMode;
set
{
if (ThemeMode == value) return;
_appData.ThemeMode = value;
OnPropertyChanged();
OnPropertyChanged(nameof(IsThemeSystem));
OnPropertyChanged(nameof(IsThemeLight));
OnPropertyChanged(nameof(IsThemeDark));
ApplyThemeMode();
}
}
public bool IsThemeSystem { get => ThemeMode == "system"; set { if (value) ThemeMode = "system"; } }
public bool IsThemeLight { get => ThemeMode == "light"; set { if (value) ThemeMode = "light"; } }
public bool IsThemeDark { get => ThemeMode == "dark"; set { if (value) ThemeMode = "dark"; } }
private void ApplyThemeMode()
{
IsDarkMode = ThemeMode switch
{
"light" => false,
"dark" => true,
_ => SystemPrefs.IsDarkMode()
};
}
/// <summary>Windows switched light/dark: follow it when the app is set to "system".</summary>
public void OnSystemThemeChanged()
{
if (ThemeMode == "system") ApplyThemeMode();
}
public string DataFolder => DataService.DefaultDataDirectory;
// ---------- window placement ----------
public Rect? SavedWindowBounds =>
_appData.WindowWidth is double w && _appData.WindowHeight is double h && _appData.WindowLeft is double l && _appData.WindowTop is double t
? new Rect(l, t, w, h) : null;
public bool SavedWindowMaximized => _appData.WindowMaximized;
public void RememberWindow(Rect bounds, bool maximized)
{
_appData.WindowLeft = bounds.Left;
_appData.WindowTop = bounds.Top;
_appData.WindowWidth = bounds.Width;
_appData.WindowHeight = bounds.Height;
_appData.WindowMaximized = maximized;
}
public bool PlaySound public bool PlaySound
{ {
@@ -384,6 +452,8 @@ namespace ReminderOrganizer.ViewModels
public ICommand ClearSearchCommand { get; } public ICommand ClearSearchCommand { get; }
public ICommand EditCategoriesCommand { get; } public ICommand EditCategoriesCommand { get; }
public ICommand ShowCategoryCommand { get; } public ICommand ShowCategoryCommand { get; }
public ICommand OpenSettingsCommand { get; }
public ICommand OpenDataFolderCommand { get; }
public MainViewModel( public MainViewModel(
IDataService dataService, IDataService dataService,
@@ -402,6 +472,7 @@ namespace ReminderOrganizer.ViewModels
_appData.Categories.FirstOrDefault(c => c.Id == id) ?? _appData.Categories.FirstOrDefault(); _appData.Categories.FirstOrDefault(c => c.Id == id) ?? _appData.Categories.FirstOrDefault();
ReminderTask.DisplayCulture = () => new System.Globalization.CultureInfo(_localizationService.CurrentLanguage == "de" ? "de-DE" : "en-US"); ReminderTask.DisplayCulture = () => new System.Globalization.CultureInfo(_localizationService.CurrentLanguage == "de" ? "de-DE" : "en-US");
ReminderTask.RelativeFormatter = RelativeText; ReminderTask.RelativeFormatter = RelativeText;
ReminderTask.RecurrenceFormatter = type => L(type.ToString());
// Empty name = refresh every binding (all texts depend on the language). // Empty name = refresh every binding (all texts depend on the language).
_localizationService.StringsChanged += (s, e) => _localizationService.StringsChanged += (s, e) =>
@@ -418,7 +489,7 @@ namespace ReminderOrganizer.ViewModels
AddTaskToFolderCommand = new RelayCommand<Folder>(AddTaskToFolder); AddTaskToFolderCommand = new RelayCommand<Folder>(AddTaskToFolder);
DeleteTaskCommand = new RelayCommand<ReminderTask>(DeleteTask); DeleteTaskCommand = new RelayCommand<ReminderTask>(DeleteTask);
EditTaskCommand = new RelayCommand<ReminderTask>(EditTask); EditTaskCommand = new RelayCommand<ReminderTask>(EditTask);
ToggleDoneCommand = new RelayCommand<ReminderTask>(t => { _ = SaveAsync(); }); ToggleDoneCommand = new RelayCommand<ReminderTask>(ToggleDone);
DeleteFolderCommand = new RelayCommand(DeleteFolder, () => SelectedFolder != null); DeleteFolderCommand = new RelayCommand(DeleteFolder, () => SelectedFolder != null);
RenameFolderCommand = new RelayCommand(RenameFolder, () => SelectedFolder != null); RenameFolderCommand = new RelayCommand(RenameFolder, () => SelectedFolder != null);
MoveFolderUpCommand = new RelayCommand(() => MoveFolderBy(-1), () => SelectedFolder != null && Folders.IndexOf(SelectedFolder) > 0); MoveFolderUpCommand = new RelayCommand(() => MoveFolderBy(-1), () => SelectedFolder != null && Folders.IndexOf(SelectedFolder) > 0);
@@ -430,7 +501,7 @@ namespace ReminderOrganizer.ViewModels
SetLanguageEnCommand = new RelayCommand(() => _localizationService.SetLanguage("en")); SetLanguageEnCommand = new RelayCommand(() => _localizationService.SetLanguage("en"));
ToggleDarkModeCommand = new RelayCommand(() => IsDarkMode = !IsDarkMode); ToggleDarkModeCommand = new RelayCommand(() => IsDarkMode = !IsDarkMode);
TogglePlaySoundCommand = new RelayCommand(() => PlaySound = !PlaySound); TogglePlaySoundCommand = new RelayCommand(() => PlaySound = !PlaySound);
ExitCommand = new RelayCommand(() => Application.Current.Shutdown()); ExitCommand = new RelayCommand(App.Quit);
MoveTaskToFolderCommand = new RelayCommand<(ReminderTask, Folder)>(MoveTaskToFolder); MoveTaskToFolderCommand = new RelayCommand<(ReminderTask, Folder)>(MoveTaskToFolder);
TestNotificationCommand = new RelayCommand(TestNotification); TestNotificationCommand = new RelayCommand(TestNotification);
ImportCsvCommand = new RelayCommand(ImportCsv); ImportCsvCommand = new RelayCommand(ImportCsv);
@@ -439,6 +510,13 @@ namespace ReminderOrganizer.ViewModels
OpenDiscordCommand = new RelayCommand(OpenDiscord); OpenDiscordCommand = new RelayCommand(OpenDiscord);
ShowUpcomingCommand = new RelayCommand(() => ShowCategory(null)); ShowUpcomingCommand = new RelayCommand(() => ShowCategory(null));
ShowCategoryCommand = new RelayCommand<string>(ShowCategory); ShowCategoryCommand = new RelayCommand<string>(ShowCategory);
OpenSettingsCommand = new RelayCommand(() =>
new SettingsWindow(this) { Owner = Application.Current.MainWindow }.ShowDialog());
OpenDataFolderCommand = new RelayCommand(() =>
{
try { System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo { FileName = DataFolder, UseShellExecute = true }); }
catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"[OpenDataFolder] {ex.Message}"); }
});
UndoCommand = new RelayCommand(Undo); UndoCommand = new RelayCommand(Undo);
ClearSearchCommand = new RelayCommand(() => { SearchText = ""; FilterMode = TaskFilterMode.All; CategoryFilter = null; }); ClearSearchCommand = new RelayCommand(() => { SearchText = ""; FilterMode = TaskFilterMode.All; CategoryFilter = null; });
EditCategoriesCommand = new RelayCommand(EditCategories); EditCategoriesCommand = new RelayCommand(EditCategories);
@@ -465,7 +543,11 @@ namespace ReminderOrganizer.ViewModels
bool changed = _appData.EnsureDefaultCategories(L); bool changed = _appData.EnsureDefaultCategories(L);
changed |= _appData.MigrateBirthdays() > 0; changed |= _appData.MigrateBirthdays() > 0;
if (changed) await SaveAsync(); if (changed) await SaveAsync();
_isDarkMode = _appData.IsDarkMode.Value; // Older files only knew IsDarkMode: keep their explicit choice; new installs follow Windows.
if (string.IsNullOrEmpty(_appData.ThemeMode))
_appData.ThemeMode = firstRun ? "system" : (_appData.IsDarkMode.Value ? "dark" : "light");
_isDarkMode = ThemeMode switch { "light" => false, "dark" => true, _ => SystemPrefs.IsDarkMode() };
_appData.IsDarkMode = _isDarkMode;
_appData.Folders.CollectionChanged += (s, e) => { HookFolders(); ReindexTasks(); }; _appData.Folders.CollectionChanged += (s, e) => { HookFolders(); ReindexTasks(); };
HookFolders(); HookFolders();
ReindexTasks(); ReindexTasks();
@@ -703,6 +785,30 @@ namespace ReminderOrganizer.ViewModels
_ = SaveAsync(); _ = SaveAsync();
} }
/// <summary>
/// The check box already flipped IsNotified. One-off tasks are simply done/undone.
/// Recurring tasks (and anniversaries) are never "done for ever": checking moves them to the next date.
/// </summary>
private void ToggleDone(ReminderTask? task)
{
if (task == null) return;
if (task.IsRecurring && task.IsNotified)
{
var oldDate = task.ReminderDate;
var oldPre = task.IsPreNotified;
var from = oldDate > DateTime.Now ? oldDate : DateTime.Now;
task.IsNotified = false;
task.ReminderDate = task.GetNextOccurrence(from);
task.IsPreNotified = false;
OfferUndo(string.Format(L("MovedToNext"), task.Name, task.DisplayDate), () =>
{
task.ReminderDate = oldDate;
task.IsPreNotified = oldPre;
});
}
_ = SaveAsync();
}
private void EditTask(ReminderTask? task) private void EditTask(ReminderTask? task)
{ {
if (task == null) return; if (task == null) return;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 31 KiB

29
tools/make_icon.py Normal file
View File

@@ -0,0 +1,29 @@
import sys
from PIL import Image, ImageDraw, ImageFont
out = sys.argv[1]
S = 1024
# background: rounded square, calm vertical gradient (no gloss)
grad = Image.new("RGBA", (S, S))
top, bot = (112, 112, 236), (78, 78, 206)
gd = ImageDraw.Draw(grad)
for y in range(S):
t = y / (S - 1)
gd.line([(0, y), (S, y)], fill=tuple(int(top[i] + (bot[i] - top[i]) * t) for i in range(3)) + (255,))
mask = Image.new("L", (S, S), 0)
m = 56
ImageDraw.Draw(mask).rounded_rectangle([m, m, S - m, S - m], radius=int(S * 0.21), fill=255)
img = Image.new("RGBA", (S, S), (0, 0, 0, 0))
img.paste(grad, (0, 0), mask)
# solid bell: render outline glyph, flood-fill the outside, everything else = bell
font = ImageFont.truetype(r"C:\Windows\Fonts\SegoeIcons.ttf", 520)
g = Image.new("L", (S, S), 0)
gdraw = ImageDraw.Draw(g)
bbox = gdraw.textbbox((0, 0), "\uEA8F", font=font)
w, h = bbox[2] - bbox[0], bbox[3] - bbox[1]
gdraw.text(((S - w) / 2 - bbox[0], (S - h) / 2 - bbox[1] + 6), "\uEA8F", font=font, fill=255)
ImageDraw.floodfill(g, (2, 2), 128)
solid = g.point(lambda v: 0 if v == 128 else 255)
img.paste(Image.new("RGBA", (S, S), (255, 255, 255, 255)), (0, 0), solid)
img.save(out)