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

Commit 594d6e6

Browse files
Updating Window to give InitializeView its own tab
1 parent 0164af3 commit 594d6e6

File tree

1 file changed

+14
-5
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/UI

1 file changed

+14
-5
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Window : BaseWindow
1414
private const string Title = "GitHub";
1515
private const string LaunchMenu = "Window/GitHub";
1616
private const string BadNotificationDelayError = "A delay of {0} is shorter than the default delay and thus would get pre-empted.";
17+
private const string InitializeTitle = "Initialize";
1718
private const string HistoryTitle = "History";
1819
private const string ChangesTitle = "Changes";
1920
private const string BranchesTitle = "Branches";
@@ -157,9 +158,10 @@ public override void OnUI()
157158
if (HasRepository)
158159
{
159160
DoHeaderGUI();
160-
DoToolbarGUI();
161161
}
162162

163+
DoToolbarGUI();
164+
163165
if (nextTab.HasValue)
164166
{
165167
SetActiveTab(nextTab.Value);
@@ -225,7 +227,7 @@ private bool MaybeUpdateData(out string repoRemote)
225227
}
226228
else
227229
{
228-
if (activeTab != SubTab.InitProject)
230+
if (!(activeTab == SubTab.InitProject || activeTab == SubTab.Settings))
229231
{
230232
if (!nextTab.HasValue || nextTab.Value != SubTab.InitProject)
231233
{
@@ -296,9 +298,16 @@ private void DoToolbarGUI()
296298
SubTab changeTab = activeTab;
297299
EditorGUI.BeginChangeCheck();
298300
{
299-
changeTab = TabButton(SubTab.Changes, ChangesTitle, changeTab);
300-
changeTab = TabButton(SubTab.History, HistoryTitle, changeTab);
301-
changeTab = TabButton(SubTab.Branches, BranchesTitle, changeTab);
301+
if (HasRepository)
302+
{
303+
changeTab = TabButton(SubTab.Changes, ChangesTitle, changeTab);
304+
changeTab = TabButton(SubTab.History, HistoryTitle, changeTab);
305+
changeTab = TabButton(SubTab.Branches, BranchesTitle, changeTab);
306+
}
307+
else
308+
{
309+
changeTab = TabButton(SubTab.InitProject, InitializeTitle, changeTab);
310+
}
302311
changeTab = TabButton(SubTab.Settings, SettingsTitle, changeTab);
303312
}
304313

0 commit comments

Comments
 (0)