feature: stage/unstage hunk (#265)

This commit is contained in:
leo 2024-07-17 16:56:16 +08:00
parent b9ed0987eb
commit b7e0e38de3
No known key found for this signature in database
18 changed files with 688 additions and 120 deletions

View file

@ -57,13 +57,13 @@ namespace SourceGit.Views
private static readonly string[] INDICATOR = ["?", "±", "+", "", "➜", "❏", "U", "★"];
public static readonly StyledProperty<bool> IsWorkingCopyChangeProperty =
AvaloniaProperty.Register<ChangeStatusIcon, bool>(nameof(IsWorkingCopyChange));
public static readonly StyledProperty<bool> IsUnstagedChangeProperty =
AvaloniaProperty.Register<ChangeStatusIcon, bool>(nameof(IsUnstagedChange));
public bool IsWorkingCopyChange
public bool IsUnstagedChange
{
get => GetValue(IsWorkingCopyChangeProperty);
set => SetValue(IsWorkingCopyChangeProperty, value);
get => GetValue(IsUnstagedChangeProperty);
set => SetValue(IsUnstagedChangeProperty, value);
}
public static readonly StyledProperty<Models.Change> ChangeProperty =
@ -77,7 +77,7 @@ namespace SourceGit.Views
static ChangeStatusIcon()
{
AffectsRender<ChangeStatusIcon>(IsWorkingCopyChangeProperty, ChangeProperty);
AffectsRender<ChangeStatusIcon>(IsUnstagedChangeProperty, ChangeProperty);
}
public override void Render(DrawingContext context)
@ -89,7 +89,7 @@ namespace SourceGit.Views
IBrush background;
string indicator;
if (IsWorkingCopyChange)
if (IsUnstagedChange)
{
if (Change.IsConflit)
{