mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 02:45:00 +00:00
feature: show tags count in tags tree (#1306)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
5b72b15cf2
commit
6bf930a9e0
3 changed files with 24 additions and 6 deletions
|
@ -26,6 +26,7 @@ namespace SourceGit.ViewModels
|
|||
public Models.Tag Tag { get; private set; } = null;
|
||||
public TagTreeNodeToolTip ToolTip { get; private set; } = null;
|
||||
public List<TagTreeNode> Children { get; private set; } = [];
|
||||
public int Counter { get; set; } = 0;
|
||||
|
||||
public bool IsFolder
|
||||
{
|
||||
|
@ -38,6 +39,11 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _isExpanded, value);
|
||||
}
|
||||
|
||||
public string TagsCount
|
||||
{
|
||||
get => Counter > 0 ? $"({Counter})" : string.Empty;
|
||||
}
|
||||
|
||||
public TagTreeNode(Models.Tag t, int depth)
|
||||
{
|
||||
FullPath = t.Name;
|
||||
|
@ -52,6 +58,7 @@ namespace SourceGit.ViewModels
|
|||
FullPath = path;
|
||||
Depth = depth;
|
||||
IsExpanded = isExpanded;
|
||||
Counter = 1;
|
||||
}
|
||||
|
||||
public static List<TagTreeNode> Build(IList<Models.Tag> tags, HashSet<string> expaneded)
|
||||
|
@ -77,6 +84,7 @@ namespace SourceGit.ViewModels
|
|||
if (folders.TryGetValue(folder, out var value))
|
||||
{
|
||||
lastFolder = value;
|
||||
lastFolder.Counter++;
|
||||
}
|
||||
else if (lastFolder == null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue