fix: branch tree not restore last IsExpanded nodes. See issue #20

* Binding IsExpanded property of TreeViewItem with Models.BranchTreeNode
* Current local branch should never be collapsed
This commit is contained in:
leo 2024-03-09 20:58:00 +08:00
parent ef26f5b41c
commit 213f04a57b
2 changed files with 13 additions and 2 deletions

View file

@ -114,7 +114,7 @@ namespace SourceGit.Models {
lastFolder = new BranchTreeNode() {
Name = subs[i],
Type = BranchTreeNodeType.Folder,
IsExpanded = _expanded.Contains(path),
IsExpanded = branch.IsCurrent || _expanded.Contains(path),
};
roots.Add(lastFolder);
_maps.Add(path, lastFolder);
@ -122,7 +122,7 @@ namespace SourceGit.Models {
var folder = new BranchTreeNode() {
Name = subs[i],
Type = BranchTreeNodeType.Folder,
IsExpanded = _expanded.Contains(path),
IsExpanded = branch.IsCurrent || _expanded.Contains(path),
};
_maps.Add(path, folder);
lastFolder.Children.Add(folder);