Birthday entry type, relative dates, list/compact/cards views
- Task dialog: Appointment | Birthday switch. Birthday = name + "19.03." or "19.03.1986" (no time), live preview with weekday, age and days left - Birthday folders open the birthday form; yearly tasks in such folders are migrated once - Birthdays show "19. Maerz" instead of date + time; every task shows "in 15 days" / "3 days ago" (red when overdue) - View switch: list, compact (one line), cards (calendar tiles), persisted - ICS: birthdays as all-day events - 59 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<Window x:Class="ReminderOrganizer.TaskWindow"
|
||||
<Window x:Class="ReminderOrganizer.TaskWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="{Binding WindowTitle}"
|
||||
@@ -20,6 +20,27 @@
|
||||
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/>
|
||||
<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">
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
@@ -113,13 +134,49 @@
|
||||
|
||||
<!-- Content -->
|
||||
<StackPanel Grid.Row="1" Margin="18,16,18,18">
|
||||
<!-- Type: appointment / birthday -->
|
||||
<Border CornerRadius="8" Background="{DynamicResource InputBackgroundBrush}" Padding="3" Margin="0,0,0,14" HorizontalAlignment="Left">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton GroupName="type" IsChecked="{Binding IsAppointment}" Style="{StaticResource Segment}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="12" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||
<TextBlock Text="{Binding AppointmentText}"/>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton GroupName="type" IsChecked="{Binding IsBirthday}" Style="{StaticResource Segment}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="12" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||
<TextBlock Text="{Binding BirthdayTypeText}"/>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<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}}"/>
|
||||
|
||||
<TextBlock Text="{Binding DateLabel}" Style="{StaticResource Label}" Margin="0,14,0,4"/>
|
||||
<Grid>
|
||||
<!-- Birthday: one date field, no time -->
|
||||
<StackPanel Visibility="{Binding IsBirthday, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding BirthdayLabel}" Style="{StaticResource Label}" Margin="0,14,0,4"/>
|
||||
<TextBox x:Name="BirthdayBox" Text="{Binding BirthdayText, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}" FontSize="15"/>
|
||||
<TextBlock Text="{Binding BirthdayPreview}" FontSize="12" Margin="0,6,0,0" TextWrapping="Wrap">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding BirthdayInvalid}" Value="True">
|
||||
<Setter Property="Foreground" Value="#EF4444"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Appointment: date, time, recurrence -->
|
||||
<StackPanel Visibility="{Binding IsAppointment, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding DateLabel}" Style="{StaticResource Label}" Margin="0,14,0,4"/> <Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -181,14 +238,6 @@
|
||||
<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>
|
||||
|
||||
<!-- Birth year (yearly only) -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0"
|
||||
Visibility="{Binding IsYearly, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding BirthYearLabel}" FontSize="12" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center" Width="150"/>
|
||||
<TextBox Text="{Binding BirthYearText, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}" Width="80" Padding="8,4" MaxLength="4"/>
|
||||
<TextBlock Text="!" Foreground="#EF4444" FontWeight="Bold" Margin="8,0,0,0" VerticalAlignment="Center"
|
||||
Visibility="{Binding BirthYearError, Converter={StaticResource BoolToVisibility}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Lead reminder -->
|
||||
|
||||
Reference in New Issue
Block a user