Skip to content

Commit c8b27b3

Browse files
committed
feat: accent-bordered highlighting for programs installed in the last 7 days
1 parent 7ba593a commit c8b27b3

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/DeepPurge.App/Views/MainWindow.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,16 @@
668668
ItemsSource="{Binding FilteredPrograms}"
669669
SelectionChanged="Programs_SelectionChanged"
670670
MouseDoubleClick="Programs_DoubleClick">
671+
<DataGrid.RowStyle>
672+
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
673+
<Style.Triggers>
674+
<DataTrigger Binding="{Binding IsRecentlyInstalled}" Value="True">
675+
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
676+
<Setter Property="BorderThickness" Value="3,0,0,0"/>
677+
</DataTrigger>
678+
</Style.Triggers>
679+
</Style>
680+
</DataGrid.RowStyle>
671681
<DataGrid.ContextMenu>
672682
<ContextMenu>
673683
<MenuItem Header="Uninstall" Tag="&#xE74D;" Click="Uninstall_Click"/>

src/DeepPurge.Core/Models/InstalledProgram.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ public string InstallDateDisplay
8282
}
8383
}
8484

85+
public bool IsRecentlyInstalled
86+
{
87+
get
88+
{
89+
if (string.IsNullOrEmpty(InstallDate) || InstallDate.Length != 8) return false;
90+
try
91+
{
92+
var dt = DateTime.ParseExact(InstallDate, "yyyyMMdd", null);
93+
return (DateTime.Now - dt).TotalDays <= 7;
94+
}
95+
catch { return false; }
96+
}
97+
}
98+
8599
public bool HasUninstaller => !string.IsNullOrEmpty(UninstallString);
86100
public bool HasQuietUninstaller => !string.IsNullOrEmpty(QuietUninstallString);
87101

0 commit comments

Comments
 (0)