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

Commit 77411b9

Browse files
Merge branch 'fixes/menu-header-disappears' into enhancements/branches-view-rollup
# Conflicts: # src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs
2 parents 8628674 + 6063893 commit 77411b9

File tree

1 file changed

+6
-15
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/UI

1 file changed

+6
-15
lines changed

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class Window : BaseWindow
4040
[SerializeField] private CacheUpdateEvent lastCurrentBranchAndRemoteChangedEvent;
4141
[NonSerialized] private bool currentBranchAndRemoteHasUpdate;
4242

43-
[NonSerialized] private Texture2D smallLogo;
44-
4543
[MenuItem(LaunchMenu)]
4644
public static void Window_GitHub()
4745
{
@@ -94,6 +92,8 @@ public override void Initialize(IApplicationManager applicationManager)
9492
BranchesView.InitializeView(this);
9593
SettingsView.InitializeView(this);
9694
InitProjectView.InitializeView(this);
95+
96+
titleContent = new GUIContent(Title, Styles.SmallLogo);
9797
}
9898

9999
public override void OnEnable()
@@ -103,13 +103,6 @@ public override void OnEnable()
103103
#if DEVELOPER_BUILD
104104
Selection.activeObject = this;
105105
#endif
106-
// Set window title
107-
if (smallLogo == null)
108-
{
109-
smallLogo = Styles.SmallLogo;
110-
titleContent = new GUIContent(Title, smallLogo);
111-
}
112-
113106
if (Repository != null)
114107
Repository.CheckCurrentBranchAndRemoteChangedEvent(lastCurrentBranchAndRemoteChangedEvent);
115108

@@ -127,8 +120,6 @@ public override void OnDisable()
127120
public override void OnDataUpdate()
128121
{
129122
base.OnDataUpdate();
130-
if (titleContent.image == null)
131-
titleContent = new GUIContent(Title, Styles.SmallLogo);
132123
MaybeUpdateData();
133124

134125
if (ActiveView != null)
@@ -204,7 +195,7 @@ private void MaybeUpdateData()
204195

205196
if (Repository != null)
206197
{
207-
if (currentBranchAndRemoteHasUpdate)
198+
if (repoBranch == null || repoRemote == null || currentBranchAndRemoteHasUpdate)
208199
{
209200
var repositoryCurrentBranch = Repository.CurrentBranch;
210201
var updatedRepoBranch = repositoryCurrentBranch.HasValue ? repositoryCurrentBranch.Value.Name : null;
@@ -259,13 +250,13 @@ private void MaybeUpdateData()
259250
}
260251
}
261252

262-
if (shouldUpdateContentFields)
253+
if (shouldUpdateContentFields || repoBranchContent == null || repoUrlContent == null)
263254
{
264255
repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip);
265256

266-
if (updatedRepoRemote != null)
257+
if (repoRemote != null)
267258
{
268-
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, updatedRepoRemote));
259+
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, repoRemote));
269260
}
270261
else
271262
{

0 commit comments

Comments
 (0)