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

Commit df68478

Browse files
Merge branch 'fixes/long-publish-error-message' into fixes/api-failure-switch-auth-view
2 parents 5aa8092 + 45a08b3 commit df68478

File tree

1 file changed

+9
-67
lines changed

1 file changed

+9
-67
lines changed

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

Lines changed: 9 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PublishView : Subview
2020
private const string SelectedOwnerLabel = "Owner";
2121
private const string RepositoryNameLabel = "Repository Name";
2222
private const string DescriptionLabel = "Description";
23-
private const string CreatePrivateRepositoryLabel = "Create as a private repository";
23+
private const string CreatePrivateRepositoryLabel = "Make repository private";
2424
private const string PublishLimtPrivateRepositoriesError = "You are currently at your limt of private repositories";
2525
private const string AuthenticationChangedMessageFormat = "You were authenticated as \"{0}\", but you are now authenticated as \"{1}\". Would you like to proceed or logout?";
2626
private const string AuthenticationChangedTitle = "Authentication Changed";
@@ -157,76 +157,18 @@ private void LoadOwners()
157157

158158
public override void OnGUI()
159159
{
160-
GUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
161-
{
162-
GUILayout.BeginVertical(GUILayout.Width(16));
163-
{
164-
GUILayout.Space(9);
165-
GUILayout.Label(Styles.BigLogo, GUILayout.Height(20), GUILayout.Width(20));
166-
}
167-
GUILayout.EndVertical();
168-
169-
GUILayout.BeginVertical();
170-
{
171-
GUILayout.Space(11);
172-
GUILayout.Label(Title, EditorStyles.boldLabel);
173-
}
174-
GUILayout.EndVertical();
175-
}
176-
GUILayout.EndHorizontal();
177-
178-
GUILayout.Space(Styles.PublishViewSpacingHeight);
160+
GUILayout.Label("Publish to GitHub", EditorStyles.boldLabel);
179161

180162
EditorGUI.BeginDisabledGroup(isBusy);
181163
{
182-
GUILayout.BeginHorizontal();
183-
{
184-
GUILayout.BeginVertical();
185-
{
186-
GUILayout.Label(SelectedOwnerLabel);
187-
selectedOwner = EditorGUILayout.Popup(selectedOwner, owners);
188-
}
189-
GUILayout.EndVertical();
190-
191-
GUILayout.BeginVertical(GUILayout.Width(8));
192-
{
193-
GUILayout.Space(20);
194-
GUILayout.Label("/");
195-
}
196-
GUILayout.EndVertical();
197-
198-
GUILayout.BeginVertical();
199-
{
200-
GUILayout.Label(RepositoryNameLabel);
201-
repoName = EditorGUILayout.TextField(repoName);
202-
}
203-
GUILayout.EndVertical();
204-
}
205-
GUILayout.EndHorizontal();
206-
207-
GUILayout.Label(DescriptionLabel);
208-
repoDescription = EditorGUILayout.TextField(repoDescription);
209-
GUILayout.Space(Styles.PublishViewSpacingHeight);
164+
selectedOwner = EditorGUILayout.Popup(SelectedOwnerLabel, selectedOwner, owners);
165+
repoName = EditorGUILayout.TextField(RepositoryNameLabel, repoName);
166+
repoDescription = EditorGUILayout.TextField(DescriptionLabel, repoDescription);
210167

211-
GUILayout.BeginVertical();
212-
{
213-
GUILayout.BeginHorizontal();
214-
{
215-
togglePrivate = GUILayout.Toggle(togglePrivate, CreatePrivateRepositoryLabel);
216-
}
217-
GUILayout.EndHorizontal();
218-
219-
GUILayout.BeginHorizontal();
220-
{
221-
GUILayout.Space(Styles.PublishViewSpacingHeight);
222-
var repoPrivacyExplanation = togglePrivate ? PrivateRepoMessage : PublicRepoMessage;
223-
GUILayout.Label(repoPrivacyExplanation, Styles.LongMessageStyle);
224-
}
225-
GUILayout.EndHorizontal();
226-
}
227-
GUILayout.EndVertical();
168+
togglePrivate = EditorGUILayout.Toggle(CreatePrivateRepositoryLabel, togglePrivate);
228169

229-
GUILayout.Space(Styles.PublishViewSpacingHeight);
170+
var repoPrivacyExplanation = togglePrivate ? PrivateRepoMessage : PublicRepoMessage;
171+
EditorGUILayout.HelpBox(repoPrivacyExplanation, MessageType.None);
230172

231173
GUILayout.BeginHorizontal();
232174
{
@@ -278,7 +220,7 @@ public override void OnGUI()
278220
GUILayout.Space(10);
279221

280222
if (error != null)
281-
GUILayout.Label(error, Styles.ErrorLabel);
223+
EditorGUILayout.HelpBox(error, MessageType.Error);
282224

283225
GUILayout.FlexibleSpace();
284226
}

0 commit comments

Comments
 (0)