code_style: remove unused converters

This commit is contained in:
leo 2024-07-25 15:33:41 +08:00
parent e9fa9a42ca
commit 1d5331cf73
No known key found for this signature in database

View file

@ -1,46 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace SourceGit.Converters
{
public static class DecoratorTypeConverters
{
public static readonly FuncValueConverter<Models.DecoratorType, IBrush> ToBackground =
new FuncValueConverter<Models.DecoratorType, IBrush>(v =>
{
if (v == Models.DecoratorType.Tag)
return Application.Current.FindResource("Brush.DecoratorTag") as IBrush;
return Application.Current.FindResource("Brush.DecoratorBranch") as IBrush;
});
public static readonly FuncValueConverter<Models.DecoratorType, StreamGeometry> ToIcon =
new FuncValueConverter<Models.DecoratorType, StreamGeometry>(v =>
{
var key = "Icons.Tag";
switch (v)
{
case Models.DecoratorType.CurrentBranchHead:
key = "Icons.Check";
break;
case Models.DecoratorType.RemoteBranchHead:
key = "Icons.Remote";
break;
case Models.DecoratorType.LocalBranchHead:
key = "Icons.Branch";
break;
default:
break;
}
return Application.Current?.FindResource(key) as StreamGeometry;
});
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
? FontWeight.Bold : FontWeight.Regular
);
}
}