mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
feature: add hotkeys Ctrl+Shift+P
(on Windows/Linux) and ⌘+,
(on macOS) to open Preference
dialog
This commit is contained in:
parent
f4c4c5eb9b
commit
3fffb0b229
5 changed files with 26 additions and 12 deletions
|
@ -98,6 +98,15 @@ namespace SourceGit.Views
|
|||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
var vm = DataContext as ViewModels.Launcher;
|
||||
|
||||
// Ctrl+Shift+P opens preference dialog (macOS use hotkeys in system menu bar)
|
||||
if (!OperatingSystem.IsMacOS() && e.KeyModifiers == (KeyModifiers.Control | KeyModifiers.Shift) && e.Key == Key.P)
|
||||
{
|
||||
App.OpenPreferenceCommand.Execute(null);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) ||
|
||||
(!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control)))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue