Fix data loss risk, reminder bugs; theme, credits, tests
- Store tasks in %APPDATA% (single-file extract dir lost data on update), atomic serialized saves, corrupt-file backup, migration of old tasks.json - Reminders without description never showed (empty balloon text threw) - Catch up missed reminders on start; monthly recurrence no longer drifts - Task dialog: date pick kept 00:00, cancel leaked recurrence changes - CSV import understands quoted fields written by export - Confirm before deleting; name folders on create; tasks sorted by date - Single instance, autostart starts hidden in tray, tray icon disposed - Theme helper for all dialogs, MDL2/Path icons instead of emojis, fixed folder selection/badge, localized counts and messages - Credits (c) Michael Media + Discord link, exe Company/Copyright - Locales embedded; xUnit tests (24); README, CLAUDE.md, sprite-generator Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
171
TaskWindow.xaml
171
TaskWindow.xaml
@@ -1,9 +1,8 @@
|
||||
<Window x:Class="ReminderOrganizer.TaskWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:models="clr-namespace:ReminderOrganizer.Models"
|
||||
Title="{Binding WindowTitle}"
|
||||
Height="420" Width="420"
|
||||
Title="{Binding WindowTitle}"
|
||||
Width="440" SizeToContent="Height"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
@@ -13,58 +12,121 @@
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown">
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="PrimaryBrush" Color="#6366F1"/>
|
||||
<SolidColorBrush x:Key="PrimaryHoverBrush" Color="#4F46E5"/>
|
||||
<SolidColorBrush x:Key="WarningBrush" Color="#F59E0B"/>
|
||||
<SolidColorBrush x:Key="TextPrimaryBrush" Color="#1E293B"/>
|
||||
<SolidColorBrush x:Key="TextSecondaryBrush" Color="#64748B"/>
|
||||
<SolidColorBrush x:Key="BorderBrush" Color="#CBD5E1"/>
|
||||
<SolidColorBrush x:Key="CardBrush" Color="#FFFFFF"/>
|
||||
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/>
|
||||
<SolidColorBrush x:Key="HoverBrush" Color="#E2E8F0"/>
|
||||
|
||||
<Style x:Key="Label" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
|
||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Input" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="{DynamicResource InputBackgroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="CaretBrush" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="10,8"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Chip" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="Margin" Value="0,0,6,0"/>
|
||||
<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="12" Padding="10,4">
|
||||
<ContentPresenter HorizontalAlignment="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="DialogButton" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="18,8"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="8" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.4"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.85"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="12" Background="{DynamicResource CardBrush}" Margin="8">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.2" Direction="270" Color="Black"/>
|
||||
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/>
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Border Grid.Row="0" Background="{DynamicResource PrimaryBrush}" CornerRadius="12,12,0,0" Padding="16,12">
|
||||
<Border Grid.Row="0" Background="{DynamicResource PrimaryBrush}" CornerRadius="12,12,0,0" Padding="16,10">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="📋" FontSize="16" Foreground="White" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding WindowTitle}" FontSize="14" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="8,0,0,0"/>
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="15" Foreground="White" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding WindowTitle}" FontSize="14" FontWeight="SemiBold" Foreground="White" VerticalAlignment="Center" Margin="10,0,0,0"/>
|
||||
</StackPanel>
|
||||
<Button Content="✕" HorizontalAlignment="Right" Foreground="White" Background="Transparent" BorderThickness="0"
|
||||
Width="28" Height="28" Cursor="Hand" Command="{Binding CancelCommand}"/>
|
||||
<Button Content="" FontFamily="Segoe MDL2 Assets" FontSize="10" HorizontalAlignment="Right" Foreground="White" Background="Transparent" BorderThickness="0"
|
||||
Width="28" Height="28" Cursor="Hand" Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Content -->
|
||||
<StackPanel Grid.Row="1" Margin="16">
|
||||
<TextBlock Text="{Binding NameLabel}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="0,0,0,4"/>
|
||||
<TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Background="{DynamicResource InputBackgroundBrush}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="10,8" FontSize="13"/>
|
||||
<StackPanel Grid.Row="1" Margin="18,16,18,18">
|
||||
<TextBlock Text="{Binding NameLabel}" Style="{StaticResource Label}"/>
|
||||
<TextBox x:Name="NameBox" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}"/>
|
||||
<TextBlock Text="{Binding ErrorMessage}" Foreground="#EF4444" FontSize="11" Margin="0,4,0,0"
|
||||
Visibility="{Binding HasError, Converter={StaticResource BoolToVisibility}}"/>
|
||||
|
||||
<Grid Margin="0,12,0,0">
|
||||
<TextBlock Text="{Binding DateLabel}" Style="{StaticResource Label}" Margin="0,14,0,4"/>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding DateLabel}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="0,0,0,4"/>
|
||||
|
||||
<DatePicker Grid.Row="1" Grid.Column="0" SelectedDate="{Binding ReminderDate, Mode=TwoWay}" Height="32"/>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="8,0,0,0">
|
||||
<ComboBox Width="50" Height="32" SelectedIndex="{Binding SelectedHourIndex}">
|
||||
<DatePicker Grid.Column="0" SelectedDate="{Binding SelectedDay, Mode=TwoWay}" Height="32" VerticalContentAlignment="Center"/>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="8,0,0,0">
|
||||
<ComboBox Width="56" Height="32" VerticalContentAlignment="Center" SelectedIndex="{Binding SelectedHourIndex}">
|
||||
<ComboBoxItem Content="00"/><ComboBoxItem Content="01"/><ComboBoxItem Content="02"/>
|
||||
<ComboBoxItem Content="03"/><ComboBoxItem Content="04"/><ComboBoxItem Content="05"/>
|
||||
<ComboBoxItem Content="06"/><ComboBoxItem Content="07"/><ComboBoxItem Content="08"/>
|
||||
@@ -74,8 +136,8 @@
|
||||
<ComboBoxItem Content="18"/><ComboBoxItem Content="19"/><ComboBoxItem Content="20"/>
|
||||
<ComboBoxItem Content="21"/><ComboBoxItem Content="22"/><ComboBoxItem Content="23"/>
|
||||
</ComboBox>
|
||||
<TextBlock Text=":" VerticalAlignment="Center" Margin="2,0" FontSize="14"/>
|
||||
<ComboBox Width="50" Height="32" SelectedIndex="{Binding SelectedMinuteIndex}">
|
||||
<TextBlock Text=":" VerticalAlignment="Center" Margin="4,0" FontSize="14" Foreground="{DynamicResource TextPrimaryBrush}"/>
|
||||
<ComboBox Width="56" Height="32" VerticalContentAlignment="Center" SelectedIndex="{Binding SelectedMinuteIndex}">
|
||||
<ComboBoxItem Content="00"/><ComboBoxItem Content="05"/>
|
||||
<ComboBoxItem Content="10"/><ComboBoxItem Content="15"/>
|
||||
<ComboBoxItem Content="20"/><ComboBoxItem Content="25"/>
|
||||
@@ -86,31 +148,48 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,12,0,0">
|
||||
<CheckBox IsChecked="{Binding IsRecurring, Mode=TwoWay}" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="🔄" FontSize="12" Margin="4,0,0,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding RecurringLabel}" FontSize="12" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center" Margin="4,0,0,0"/>
|
||||
<ComboBox Margin="8,0,0,0" Width="90" Height="28" SelectedIndex="{Binding SelectedRecurrenceIndex}" IsEnabled="{Binding IsRecurring}">
|
||||
<!-- Quick picks -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="{Binding QuickLabel}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<Button Content="{Binding TomorrowText}" Command="{Binding SetTomorrowCommand}" Style="{StaticResource Chip}"/>
|
||||
<Button Content="{Binding NextWeekText}" Command="{Binding SetNextWeekCommand}" Style="{StaticResource Chip}"/>
|
||||
<Button Content="{Binding NextMonthText}" Command="{Binding SetNextMonthCommand}" Style="{StaticResource Chip}"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding PastDateWarning}" Foreground="{DynamicResource WarningBrush}" FontSize="11" Margin="0,6,0,0"
|
||||
Visibility="{Binding IsInPast, Converter={StaticResource BoolToVisibility}}"/>
|
||||
|
||||
<!-- Recurrence -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,14,0,0">
|
||||
<CheckBox IsChecked="{Binding IsRecurring, Mode=TwoWay}" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource TextPrimaryBrush}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="12" VerticalAlignment="Center" Foreground="{DynamicResource TextPrimaryBrush}"/>
|
||||
<TextBlock Text="{Binding RecurringLabel}" FontSize="12" Margin="6,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource TextPrimaryBrush}"/>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<ComboBox Margin="10,0,0,0" Width="100" Height="28" VerticalContentAlignment="Center"
|
||||
SelectedIndex="{Binding SelectedRecurrenceIndex}" IsEnabled="{Binding IsRecurring}">
|
||||
<ComboBoxItem Content="{Binding DailyText}"/>
|
||||
<ComboBoxItem Content="{Binding WeeklyText}"/>
|
||||
<ComboBoxItem Content="{Binding MonthlyText}"/>
|
||||
<ComboBoxItem Content="{Binding YearlyText}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,6,0,0"
|
||||
Visibility="{Binding IsRecurring, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding NextOccurrenceLabel}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Text="{Binding NextOccurrenceText}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextPrimaryBrush}" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding DescriptionLabel}" FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="0,12,0,4"/>
|
||||
<TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" Background="{DynamicResource InputBackgroundBrush}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="10,6" FontSize="12" Height="40"
|
||||
TextWrapping="Wrap" AcceptsReturn="True"/>
|
||||
<TextBlock Text="{Binding DescriptionLabel}" Style="{StaticResource Label}" Margin="0,14,0,4"/>
|
||||
<TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}"
|
||||
Height="72" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" FontSize="12"/>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMessage}" Foreground="#EF4444" FontSize="11" Margin="0,8,0,0"
|
||||
Visibility="{Binding HasError, Converter={StaticResource BoolToVisibility}}"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0">
|
||||
<Button Content="{Binding CancelText}" Background="Transparent" Foreground="{DynamicResource TextPrimaryBrush}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="16,8" Cursor="Hand" Command="{Binding CancelCommand}"/>
|
||||
<Button Content="{Binding SaveText}" Background="#6366F1" Foreground="White"
|
||||
BorderThickness="0" Padding="16,8" Margin="8,0,0,0" Cursor="Hand" Command="{Binding SaveCommand}"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,18,0,0">
|
||||
<Button Content="{Binding CancelText}" Command="{Binding CancelCommand}" Style="{StaticResource DialogButton}"/>
|
||||
<Button Content="{Binding SaveText}" Command="{Binding SaveCommand}" Style="{StaticResource DialogButton}" IsDefault="True"
|
||||
Background="{DynamicResource PrimaryBrush}" Foreground="White" BorderThickness="0" Margin="8,0,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user