This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,9 @@ private void BuildTree()
141
141
if ( treeLocals == null )
142
142
{
143
143
treeLocals = new BranchesTree ( ) ;
144
+
144
145
treeRemotes = new BranchesTree ( ) ;
146
+ treeRemotes . IsRemote = true ;
145
147
146
148
UpdateTreeIcons ( ) ;
147
149
}
@@ -167,10 +169,10 @@ private void UpdateTreeIcons()
167
169
treeLocals . ActiveNodeIcon = Styles . ActiveBranchIcon ;
168
170
}
169
171
170
- if ( treeLocals . NodeIcon == null )
172
+ if ( treeLocals . BranchIcon == null )
171
173
{
172
174
localsLoaded = true ;
173
- treeLocals . NodeIcon = Styles . BranchIcon ;
175
+ treeLocals . BranchIcon = Styles . BranchIcon ;
174
176
}
175
177
176
178
if ( treeLocals . FolderIcon == null )
@@ -188,16 +190,16 @@ private void UpdateTreeIcons()
188
190
treeRemotes . ActiveNodeIcon = Styles . ActiveBranchIcon ;
189
191
}
190
192
191
- if ( treeRemotes . NodeIcon == null )
193
+ if ( treeRemotes . BranchIcon == null )
192
194
{
193
195
remotesLoaded = true ;
194
- treeRemotes . NodeIcon = Styles . BranchIcon ;
196
+ treeRemotes . BranchIcon = Styles . BranchIcon ;
195
197
}
196
198
197
- if ( treeRemotes . RootFolderIcon == null )
199
+ if ( treeRemotes . RemoteIcon == null )
198
200
{
199
201
remotesLoaded = true ;
200
- treeRemotes . RootFolderIcon = Styles . RootFolderIcon ;
202
+ treeRemotes . RemoteIcon = Styles . RootFolderIcon ;
201
203
}
202
204
203
205
if ( treeRemotes . FolderIcon == null )
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ namespace GitHub.Unity
12
12
public class BranchesTree : Tree
13
13
{
14
14
[ NonSerialized ] public Texture2D ActiveNodeIcon ;
15
- [ NonSerialized ] public Texture2D NodeIcon ;
15
+ [ NonSerialized ] public Texture2D BranchIcon ;
16
16
[ NonSerialized ] public Texture2D FolderIcon ;
17
- [ NonSerialized ] public Texture2D RootFolderIcon ;
17
+ [ NonSerialized ] public Texture2D RemoteIcon ;
18
+
19
+ [ SerializeField ] public bool IsRemote ;
18
20
19
21
protected override Texture2D GetNodeIcon ( TreeNode node )
20
22
{
@@ -25,14 +27,13 @@ protected override Texture2D GetNodeIcon(TreeNode node)
25
27
}
26
28
else if ( node . IsFolder )
27
29
{
28
- if ( node . Level == 1 )
29
- nodeIcon = RootFolderIcon ;
30
- else
31
- nodeIcon = FolderIcon ;
30
+ nodeIcon = IsRemote && node . Level == 1
31
+ ? RemoteIcon
32
+ : FolderIcon ;
32
33
}
33
34
else
34
35
{
35
- nodeIcon = NodeIcon ;
36
+ nodeIcon = BranchIcon ;
36
37
}
37
38
return nodeIcon ;
38
39
}
You can’t perform that action at this time.
0 commit comments