feature: added Ctrl+N/⌘+N shortcut (#795)

(cherry picked from commit 726cf0d376a9af9167145560977ec6e1bf748277)
This commit is contained in:
Luigi Grilli 2024-12-09 08:35:49 +00:00 committed by leo
parent 19307cebc0
commit bea2a39feb
No known key found for this signature in database
4 changed files with 24 additions and 3 deletions

View file

@ -136,6 +136,22 @@ namespace SourceGit.Views
return;
}
if (e.Key == Key.N)
{
if (vm.ActivePage.Data is not ViewModels.Welcome)
{
vm.AddNewTab();
}
if (vm.ActivePage.Data is ViewModels.Welcome welcome)
{
welcome.Clone();
}
e.Handled = true;
return;
}
if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) ||
(!OperatingSystem.IsMacOS() && !e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab))
{