This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class ChangesView : Subview
34
34
public override void OnEnable ( )
35
35
{
36
36
base . OnEnable ( ) ;
37
+ UpdateTreeIcons ( ) ;
37
38
AttachHandlers ( Repository ) ;
38
39
39
40
if ( Repository != null )
@@ -190,18 +191,40 @@ private void BuildTree()
190
191
if ( treeChanges == null )
191
192
{
192
193
treeChanges = new Tree ( ) ;
193
- treeChanges . NodeIcon = Styles . BranchIcon ;
194
- treeChanges . FolderIcon = Styles . FolderIcon ;
195
194
treeChanges . DisplayRootNode = false ;
196
195
treeChanges . Selectable = true ;
197
196
treeChanges . PathIgnoreRoot = Environment . RepositoryPath + Environment . FileSystem . DirectorySeparatorChar ;
198
197
treeChanges . PathSeparator = Environment . FileSystem . DirectorySeparatorChar . ToString ( ) ;
198
+
199
+ UpdateTreeIcons ( ) ;
199
200
}
200
201
201
202
treeChanges . Load ( gitStatusEntries . Select ( entry => new GitStatusEntryTreeData ( entry ) ) . Cast < ITreeData > ( ) , "Changes" ) ;
202
203
Redraw ( ) ;
203
204
}
204
205
206
+ private void UpdateTreeIcons ( )
207
+ {
208
+ var loaded = false ;
209
+
210
+ if ( treeChanges . NodeIcon == null )
211
+ {
212
+ loaded = true ;
213
+ treeChanges . NodeIcon = Styles . BranchIcon ;
214
+ }
215
+
216
+ if ( treeChanges . FolderIcon == null )
217
+ {
218
+ loaded = true ;
219
+ treeChanges . FolderIcon = Styles . FolderIcon ;
220
+ }
221
+
222
+ if ( loaded )
223
+ {
224
+ treeChanges . LoadNodeIcons ( ) ;
225
+ }
226
+ }
227
+
205
228
private void OnCommitDetailsAreaGUI ( )
206
229
{
207
230
GUILayout . BeginHorizontal ( ) ;
You can’t perform that action at this time.
0 commit comments