Skip to content

Commit

Permalink
GCM release v2.2.1 (#1316)
Browse files Browse the repository at this point in the history
**Changes since 2.2.0:**

- Workaround Avalonia crashing issue on macOS (#1314)
  • Loading branch information
mjcheetham committed Jul 5, 2023
2 parents de28bd9 + 43ec9ae commit 2f5264d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0.0
2.2.1.0
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Atlassian.Bitbucket.UI.ViewModels;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using GitCredentialManager;
using GitCredentialManager.UI.Controls;

namespace Atlassian.Bitbucket.UI.Views
Expand Down Expand Up @@ -44,11 +45,15 @@ public void SetFocus()
_tabControl.SelectedIndex = 1;
if (string.IsNullOrWhiteSpace(vm.UserName))
{
_userNameTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_userNameTextBox.Focus();
}
else
{
_passwordTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_passwordTextBox.Focus();
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/shared/Core/UI/Views/CredentialsView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ public void SetFocus()

if (string.IsNullOrWhiteSpace(vm.UserName))
{
_userNameTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_userNameTextBox.Focus();
}
else
{
_passwordTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_passwordTextBox.Focus();
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/shared/GitHub/UI/Controls/SixDigitInput.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Avalonia.Input.Platform;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using GitCredentialManager;
using GitCredentialManager.UI.Controls;

namespace GitHub.UI.Controls
Expand Down Expand Up @@ -86,7 +87,9 @@ private void SetTextBoxes(string text)

public void SetFocus()
{
KeyboardDevice.Instance.SetFocusedElement(_textBoxes[0], NavigationMethod.Tab, KeyModifiers.None);
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
KeyboardDevice.Instance.SetFocusedElement(_textBoxes[0], NavigationMethod.Tab, KeyModifiers.None);
}

private void SetUpTextBox(TextBox textBox)
Expand Down
13 changes: 10 additions & 3 deletions src/shared/GitHub/UI/Views/CredentialsView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using GitCredentialManager;
using GitHub.UI.ViewModels;
using GitCredentialManager.UI.Controls;

Expand Down Expand Up @@ -53,19 +54,25 @@ public void SetFocus()
else if (vm.ShowTokenLogin)
{
_tabControl.SelectedIndex = 1;
_tokenTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_tokenTextBox.Focus();

}
else if (vm.ShowBasicLogin)
{
_tabControl.SelectedIndex = 2;
if (string.IsNullOrWhiteSpace(vm.UserName))
{
_userNameTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_userNameTextBox.Focus();
}
else
{
_passwordTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_passwordTextBox.Focus();
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/shared/GitHub/UI/Views/TwoFactorView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using GitCredentialManager;
using GitHub.UI.Controls;
using GitCredentialManager.UI.Controls;

Expand All @@ -23,7 +24,9 @@ private void InitializeComponent()

public void SetFocus()
{
_codeInput.SetFocus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_codeInput.SetFocus();
}
}
}
13 changes: 10 additions & 3 deletions src/shared/GitLab/UI/Views/CredentialsView.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using GitCredentialManager;
using GitLab.UI.ViewModels;
using GitCredentialManager.UI.Controls;

Expand Down Expand Up @@ -48,18 +49,24 @@ public void SetFocus()
else if (vm.ShowTokenLogin)
{
_tabControl.SelectedIndex = 1;
_tokenTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_tokenTextBox.Focus();
}
else if (vm.ShowBasicLogin)
{
_tabControl.SelectedIndex = 2;
if (string.IsNullOrWhiteSpace(vm.UserName))
{
_userNameTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_userNameTextBox.Focus();
}
else
{
_passwordTextBox.Focus();
// Workaround: https://github.com/git-ecosystem/git-credential-manager/issues/1293
if (!PlatformUtils.IsMacOS())
_passwordTextBox.Focus();
}
}
}
Expand Down

0 comments on commit 2f5264d

Please sign in to comment.