feat(ui): add CheckboxBorderConverter for task status circles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mika Kuns
2026-04-14 10:20:22 +02:00
parent 9f61cd1449
commit a548d41d18

View File

@@ -0,0 +1,30 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace ClaudeDo.Ui.Converters;
public sealed class CheckboxBorderConverter : IValueConverter
{
public static readonly CheckboxBorderConverter Instance = new();
private static readonly ISolidColorBrush Gray = new SolidColorBrush(Color.Parse("#475569"));
private static readonly ISolidColorBrush Orange = new SolidColorBrush(Color.Parse("#e67e22"));
private static readonly ISolidColorBrush Green = new SolidColorBrush(Color.Parse("#3d9474"));
private static readonly ISolidColorBrush Red = new SolidColorBrush(Color.Parse("#ef4444"));
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value?.ToString()?.ToLowerInvariant() switch
{
"running" => Orange,
"done" => Green,
"failed" => Red,
_ => Gray, // manual, queued
};
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotSupportedException();
}