-
Notifications
You must be signed in to change notification settings - Fork 445
A dedicated view to initialize the project #252
Conversation
0fb1ba8
to
29cc836
Compare
f36423e
to
97608d6
Compare
@@ -0,0 +1,467 @@ | |||
#pragma warning disable 649 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh me.
# Conflicts: # src/UnityExtension/Assets/Editor/GitHub.Unity/GitHub.Unity.csproj
181e0e2
to
df2e7ee
Compare
…s/initialize-view # Conflicts: # src/UnityExtension/Assets/Editor/GitHub.Unity/GitHub.Unity.csproj
@@ -158,6 +162,12 @@ public override void OnUI() | |||
|
|||
DoToolbarGUI(); | |||
|
|||
if (nextTab.HasValue) | |||
{ | |||
SetActiveTab(nextTab.Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably shouldn't be done here. We should probably be saving the tab option and triggering a Redraw to do the switch in OnDataUpdate
. As it stands we're calling OnDataUpdate on the old view, and never on the new view, since that event has already happened by the time we switch here.
TL;DR, the order of events for child views should be "OnDisable" (the old one) -> "OnEnable" (the new one) -> "OnDataUpdate" -> "OnGUI"
@@ -24,8 +25,10 @@ class Window : BaseWindow | |||
private const string Window_RepoBranchTooltip = "Active branch"; | |||
|
|||
[NonSerialized] private double notificationClearTime = -1; | |||
[SerializeField] private SubTab? nextTab; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SubTab is an enum so there's no reason to use a nullable here, just add a None option to it to know what there is no current selection.
case SubTab.Branches: | ||
return branchesView; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the extra space? Seems like a useless change.
case SubTab.Changes: | ||
return changesView; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this change
case SubTab.History: | ||
return historyView; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this change
…alize-view-thing Cleanup the switching of the tabs
As part of #251
Depends on:
Before:

After:
