Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 45e24f5

Browse files
Starting changes to ChangesTreeView
1 parent 00ddff9 commit 45e24f5

File tree

1 file changed

+13
-36
lines changed

1 file changed

+13
-36
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -563,17 +563,12 @@ public override string ToString()
563563
[Serializable]
564564
public class BranchesTree : Tree
565565
{
566-
[SerializeField]
567-
public bool IsRemote;
568-
569-
[NonSerialized]
570-
public Texture2D ActiveBranchIcon;
571-
[NonSerialized]
572-
public Texture2D BranchIcon;
573-
[NonSerialized]
574-
public Texture2D FolderIcon;
575-
[NonSerialized]
576-
public Texture2D GlobeIcon;
566+
[SerializeField] public bool IsRemote;
567+
568+
[NonSerialized] public Texture2D ActiveBranchIcon;
569+
[NonSerialized] public Texture2D BranchIcon;
570+
[NonSerialized] public Texture2D FolderIcon;
571+
[NonSerialized] public Texture2D GlobeIcon;
577572

578573
protected override Texture2D GetNodeIcon(TreeNode node)
579574
{
@@ -610,51 +605,33 @@ public void UpdateIcons(Texture2D activeBranchIcon, Texture2D branchIcon, Textur
610605
}
611606
}
612607
}
608+
613609
[Serializable]
614610
public class ChangesTree : Tree
615611
{
616-
[SerializeField]
617-
public bool IsRemote;
618-
619-
[NonSerialized]
620-
public Texture2D ActiveBranchIcon;
621-
[NonSerialized]
622-
public Texture2D BranchIcon;
623-
[NonSerialized]
624-
public Texture2D FolderIcon;
625-
[NonSerialized]
626-
public Texture2D GlobeIcon;
612+
[NonSerialized] public Texture2D FolderIcon;
627613

628614
protected override Texture2D GetNodeIcon(TreeNode node)
629615
{
630-
Texture2D nodeIcon;
631-
if (node.IsActive)
616+
Texture2D nodeIcon = null;
617+
if (node.IsFolder)
632618
{
633-
nodeIcon = ActiveBranchIcon;
634-
}
635-
else if (node.IsFolder)
636-
{
637-
nodeIcon = IsRemote && node.Level == 1
638-
? GlobeIcon
639-
: FolderIcon;
619+
nodeIcon = FolderIcon;
640620
}
641621
else
642622
{
643-
nodeIcon = BranchIcon;
623+
//nodeIcon = AssetDatabase.GetCachedIcon(node.p);
644624
}
645625
return nodeIcon;
646626
}
647627

648628

649629
public void UpdateIcons(Texture2D activeBranchIcon, Texture2D branchIcon, Texture2D folderIcon, Texture2D globeIcon)
650630
{
651-
var needsLoad = ActiveBranchIcon == null || BranchIcon == null || FolderIcon == null || GlobeIcon == null;
631+
var needsLoad = FolderIcon == null;
652632
if (needsLoad)
653633
{
654-
ActiveBranchIcon = activeBranchIcon;
655-
BranchIcon = branchIcon;
656634
FolderIcon = folderIcon;
657-
GlobeIcon = globeIcon;
658635

659636
LoadNodeIcons();
660637
}

0 commit comments

Comments
 (0)