mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
Adding HEAD decorator markup in the Graph
This commit is contained in:
parent
8aeb7ed17c
commit
4750ad0d07
4 changed files with 15 additions and 2 deletions
|
@ -146,6 +146,15 @@ namespace SourceGit.Commands
|
||||||
Name = d.Substring(19).Trim(),
|
Name = d.Substring(19).Trim(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if (d.Equals("HEAD"))
|
||||||
|
{
|
||||||
|
isHeadOfCurrent = true;
|
||||||
|
decorators.Add(new Models.Decorator()
|
||||||
|
{
|
||||||
|
Type = Models.DecoratorType.CurrentCommitHead,
|
||||||
|
Name = d.Trim(),
|
||||||
|
});
|
||||||
|
}
|
||||||
else if (d.StartsWith("refs/heads/", StringComparison.Ordinal))
|
else if (d.StartsWith("refs/heads/", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
decorators.Add(new Models.Decorator()
|
decorators.Add(new Models.Decorator()
|
||||||
|
|
|
@ -38,6 +38,9 @@ namespace SourceGit.Converters
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
|
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
|
||||||
new FuncValueConverter<Models.DecoratorType, FontWeight>(v => v == Models.DecoratorType.CurrentBranchHead ? FontWeight.Bold : FontWeight.Regular);
|
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
|
||||||
|
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
|
||||||
|
? FontWeight.Bold : FontWeight.Regular
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace SourceGit.Models
|
||||||
|
|
||||||
public bool IsCurrentHead
|
public bool IsCurrentHead
|
||||||
{
|
{
|
||||||
get => Decorators.Find(x => x.Type == DecoratorType.CurrentBranchHead) != null;
|
get => Decorators.Find(x => x.Type is DecoratorType.CurrentBranchHead or DecoratorType.CurrentCommitHead) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FullMessage
|
public string FullMessage
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace SourceGit.Models
|
||||||
None,
|
None,
|
||||||
CurrentBranchHead,
|
CurrentBranchHead,
|
||||||
LocalBranchHead,
|
LocalBranchHead,
|
||||||
|
CurrentCommitHead,
|
||||||
RemoteBranchHead,
|
RemoteBranchHead,
|
||||||
Tag,
|
Tag,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue