forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInteractiveRebaseActionConverters.cs
More file actions
28 lines (25 loc) · 1.31 KB
/
InteractiveRebaseActionConverters.cs
File metadata and controls
28 lines (25 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace SourceGit.Converters
{
public static class InteractiveRebaseActionConverters
{
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, IBrush> ToIconBrush =
new FuncValueConverter<Models.InteractiveRebaseAction, IBrush>(v =>
{
return v switch
{
Models.InteractiveRebaseAction.Pick => Brushes.Green,
Models.InteractiveRebaseAction.Edit => Brushes.Orange,
Models.InteractiveRebaseAction.Reword => Brushes.Orange,
Models.InteractiveRebaseAction.Squash => Brushes.LightGray,
Models.InteractiveRebaseAction.Fixup => Brushes.LightGray,
_ => Brushes.Red,
};
});
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, string> ToName =
new FuncValueConverter<Models.InteractiveRebaseAction, string>(v => v.ToString());
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, bool> CanEditMessage =
new FuncValueConverter<Models.InteractiveRebaseAction, bool>(v => v == Models.InteractiveRebaseAction.Reword || v == Models.InteractiveRebaseAction.Squash);
}
}