mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
enhance: hotkeys
* add `Shift+Ctrl+Tab` (`⌘+⌥+←` on macOS) to go to previous page * use `ESC` to cancel commit searching * enable `AutoFocusBehaviour` on `CommitChanges` and `RevisionFiles` tab
This commit is contained in:
parent
16741c21e6
commit
b651835de0
7 changed files with 46 additions and 16 deletions
|
@ -114,12 +114,19 @@ namespace SourceGit.Views
|
|||
return;
|
||||
}
|
||||
else if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) ||
|
||||
(!OperatingSystem.IsMacOS() && e.Key == Key.Tab))
|
||||
(!OperatingSystem.IsMacOS() && !e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab))
|
||||
{
|
||||
vm.GotoNextTab();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Left) ||
|
||||
(!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab))
|
||||
{
|
||||
vm.GotoPrevTab();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (vm.ActivePage.Data is ViewModels.Repository repo)
|
||||
{
|
||||
if (e.Key == Key.D1 || e.Key == Key.NumPad1)
|
||||
|
@ -142,7 +149,7 @@ namespace SourceGit.Views
|
|||
}
|
||||
else if (e.Key == Key.F)
|
||||
{
|
||||
repo.IsSearching = !repo.IsSearching;
|
||||
repo.IsSearching = true;
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
@ -151,6 +158,12 @@ namespace SourceGit.Views
|
|||
else if (e.Key == Key.Escape)
|
||||
{
|
||||
vm.ActivePage.CancelPopup();
|
||||
|
||||
if (vm.ActivePage.Data is ViewModels.Repository repo)
|
||||
{
|
||||
repo.IsSearching = false;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue