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

Commit 60c338a

Browse files
Cleaning up some method calls
1 parent 765fa83 commit 60c338a

File tree

3 files changed

+23
-33
lines changed

3 files changed

+23
-33
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,17 @@ public override void InitializeView(IView parent)
6262
public override void OnEnable()
6363
{
6464
base.OnEnable();
65-
TreeOnEnable();
65+
66+
if (treeLocals != null)
67+
{
68+
treeLocals.UpdateIcons(Styles.ActiveBranchIcon, Styles.BranchIcon, Styles.FolderIcon, Styles.GlobeIcon);
69+
}
70+
71+
if (treeRemotes != null)
72+
{
73+
treeRemotes.UpdateIcons(Styles.ActiveBranchIcon, Styles.BranchIcon, Styles.FolderIcon, Styles.GlobeIcon);
74+
}
75+
6676
AttachHandlers(Repository);
6777
Repository.CheckLocalAndRemoteBranchListChangedEvent(lastLocalAndRemoteBranchListChangedEvent);
6878
}
@@ -163,19 +173,6 @@ private void BuildTree()
163173
Redraw();
164174
}
165175

166-
private void TreeOnEnable()
167-
{
168-
if (treeLocals != null)
169-
{
170-
treeLocals.UpdateIcons(Styles.ActiveBranchIcon, Styles.BranchIcon, Styles.FolderIcon, Styles.GlobeIcon);
171-
}
172-
173-
if (treeRemotes != null)
174-
{
175-
treeRemotes.UpdateIcons(Styles.ActiveBranchIcon, Styles.BranchIcon, Styles.FolderIcon, Styles.GlobeIcon);
176-
}
177-
}
178-
179176
private void OnButtonBarGUI()
180177
{
181178
if (mode == BranchesMode.Default)

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ class ChangesView : Subview
4242
public override void OnEnable()
4343
{
4444
base.OnEnable();
45-
TreeOnEnable();
45+
46+
if (treeChanges != null)
47+
{
48+
treeChanges.UpdateIcons(Styles.FolderIcon);
49+
}
50+
4651
AttachHandlers(Repository);
4752
Repository.CheckCurrentBranchChangedEvent(lastCurrentBranchChangedEvent);
4853
Repository.CheckStatusEntriesChangedEvent(lastStatusEntriesChangedEvent);
@@ -217,14 +222,6 @@ private void BuildTree()
217222
Redraw();
218223
}
219224

220-
private void TreeOnEnable()
221-
{
222-
if (treeChanges != null)
223-
{
224-
treeChanges.UpdateIcons(Styles.FolderIcon);
225-
}
226-
}
227-
228225
private void OnCommitDetailsAreaGUI()
229226
{
230227
GUILayout.BeginHorizontal();

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ class HistoryView : Subview
351351
public override void OnEnable()
352352
{
353353
base.OnEnable();
354-
TreeOnEnable();
354+
355+
if (treeChanges != null)
356+
{
357+
treeChanges.UpdateIcons(Styles.FolderIcon);
358+
}
359+
355360
AttachHandlers(Repository);
356361

357362
if (Repository != null)
@@ -721,15 +726,6 @@ private void BuildTree()
721726
Redraw();
722727
}
723728

724-
private void TreeOnEnable()
725-
{
726-
if (treeChanges != null)
727-
{
728-
treeChanges.OnEnable();
729-
treeChanges.UpdateIcons(Styles.FolderIcon);
730-
}
731-
}
732-
733729
public override bool IsBusy
734730
{
735731
get { return false; }

0 commit comments

Comments
 (0)