ux: new style for tag's tooltip (#1305)

This commit is contained in:
leo 2025-05-13 12:26:33 +08:00
parent 8a45e25106
commit afc8a772dd
No known key found for this signature in database
5 changed files with 66 additions and 26 deletions

View file

@ -5,18 +5,28 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace SourceGit.ViewModels
{
public class TagTreeNodeToolTip
{
public string Name { get; private set; }
public bool IsAnnotated { get; private set; }
public string Message { get; private set; }
public TagTreeNodeToolTip(Models.Tag t)
{
Name = t.Name;
IsAnnotated = t.IsAnnotated;
Message = t.Message;
}
}
public class TagTreeNode : ObservableObject
{
public string FullPath { get; set; }
public int Depth { get; private set; } = 0;
public Models.Tag Tag { get; private set; } = null;
public TagTreeNodeToolTip ToolTip { get; private set; } = null;
public List<TagTreeNode> Children { get; private set; } = [];
public object ToolTip
{
get => Tag?.Message;
}
public bool IsFolder
{
get => Tag == null;
@ -33,6 +43,7 @@ namespace SourceGit.ViewModels
FullPath = t.Name;
Depth = depth;
Tag = t;
ToolTip = new TagTreeNodeToolTip(t);
IsExpanded = false;
}