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

A dedicated view to initialize the project #252

Merged
merged 29 commits into from
Sep 20, 2017

Conversation

StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Aug 31, 2017

@StanleyGoldman StanleyGoldman force-pushed the enhancements/initialize-view branch 2 times, most recently from 0fb1ba8 to 29cc836 Compare August 31, 2017 16:28
@StanleyGoldman StanleyGoldman force-pushed the enhancements/initialize-view branch from f36423e to 97608d6 Compare September 6, 2017 18:26
@@ -0,0 +1,467 @@
#pragma warning disable 649
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh me.

@shana shana changed the title A dedicated view to intialize the project A dedicated view to initialize the project Sep 18, 2017
@StanleyGoldman StanleyGoldman force-pushed the enhancements/initialize-view branch from 181e0e2 to df2e7ee Compare September 18, 2017 18:39
@@ -158,6 +162,12 @@ public override void OnUI()

DoToolbarGUI();

if (nextTab.HasValue)
{
SetActiveTab(nextTab.Value);
Copy link
Member

@shana shana Sep 20, 2017

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;
Copy link
Member

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;

Copy link
Member

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;

Copy link
Member

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;

Copy link
Member

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

@StanleyGoldman StanleyGoldman merged commit d4c9da5 into master Sep 20, 2017
@StanleyGoldman StanleyGoldman deleted the enhancements/initialize-view branch October 19, 2017 16:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants