Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static GUIStyle ErrorLabel
{
errorLabel = new GUIStyle(EditorStyles.label);
errorLabel.name = "ErrorLabel";

errorLabel.wordWrap = true;
errorLabel.normal.textColor = Color.red;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ namespace GitHub.Unity
[Serializable]
class AuthenticationView : Subview
{
const string serverLabel = "Server";
const string usernameLabel = "Username";
const string passwordLabel = "Password";
const string twofaLabel = "Authentication code";
const string twofaLabel = "2FA Code";
const string loginButton = "Sign in";
const string backButton = "Back";
const string authTitle = "Sign in to GitHub";
const string twofaTitle = "Two-factor authentication";
const string twofaDescription = "Open the two-factor authentication app on your device to view your authentication code and verify your identity.";
const string twofaTitle = "Two-Factor Authentication";
const string twofaDescription = "Open the two-factor authentication app on your device to view your 2FA code and verify your identity.";
const string twofaButton = "Verify";

[SerializeField] private Vector2 scroll;
Expand Down Expand Up @@ -76,6 +75,8 @@ public override void OnGUI()
{
HandleEnterPressed();

EditorGUIUtility.labelWidth = 90f;

scroll = GUILayout.BeginScrollView(scroll);
{
Rect authHeader = EditorGUILayout.BeginHorizontal(Styles.AuthHeaderBoxStyle);
Expand Down Expand Up @@ -114,7 +115,6 @@ public override void OnGUI()
}

GUILayout.EndVertical();
GUILayout.Space(Styles.BaseSpacing);
}
GUILayout.EndScrollView();
}
Expand All @@ -135,15 +135,15 @@ private void OnGUILogin()
GUILayout.BeginHorizontal();
{
if (busy) GUI.enabled = false;
username = EditorGUILayout.TextField("Username" ,username, Styles.TextFieldStyle);
username = EditorGUILayout.TextField(usernameLabel ,username, Styles.TextFieldStyle);
GUI.enabled = true;
}
GUILayout.EndHorizontal();
GUILayout.Space(Styles.BaseSpacing);
GUILayout.BeginHorizontal();
{
if (busy) GUI.enabled = false;
password = EditorGUILayout.PasswordField("Password", password, Styles.TextFieldStyle);
password = EditorGUILayout.PasswordField(passwordLabel, password, Styles.TextFieldStyle);
GUI.enabled = true;
}
GUILayout.EndHorizontal();
Expand Down Expand Up @@ -196,8 +196,6 @@ private void OnGUI2FA()
Redraw();
}

GUILayout.Space(Styles.BaseSpacing);

if (GUILayout.Button(twofaButton) || (GUI.enabled && enterPressed))
{
GUI.FocusControl(null);
Expand All @@ -209,7 +207,6 @@ private void OnGUI2FA()
GUI.enabled = true;
GUILayout.Space(Styles.BaseSpacing);
GUILayout.EndVertical();
GUILayout.Space(Styles.BaseSpacing);
}

private void DoRequire2fa(string msg)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEditor;
using UnityEngine;

Expand All @@ -7,7 +7,7 @@ namespace GitHub.Unity
[Serializable]
class AuthenticationWindow : BaseWindow
{
private const string Title = "Sign in";
private const string Title = "Authentication";

[SerializeField] private AuthenticationView authView;

Expand All @@ -19,10 +19,10 @@ public static void Launch()

public static IView Open(Action<bool> onClose = null)
{
AuthenticationWindow authWindow = GetWindow<AuthenticationWindow>();
AuthenticationWindow authWindow = GetWindow<AuthenticationWindow>(true);
if (onClose != null)
authWindow.OnClose += onClose;
authWindow.minSize = new Vector2(290, 290);
authWindow.minSize = authWindow.maxSize = new Vector2(290, 290);
authWindow.Show();
return authWindow;
}
Expand Down