From 458a1ea83c3fec8b72f04f98b19dd2574ccef4c2 Mon Sep 17 00:00:00 2001 From: wl2776 Date: Sun, 12 Jan 2025 23:33:13 -0800 Subject: [PATCH] feature: Exit on Ctrl+Q (#898) --- src/Views/Hotkeys.axaml | 5 ++++- src/Views/Launcher.axaml | 1 + src/Views/Launcher.axaml.cs | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index 1ce4bb9a..67293b50 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -45,7 +45,7 @@ FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}" Margin="0,0,0,8"/> - + @@ -66,6 +66,9 @@ + + + + diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 39abb71b..832cca80 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -146,6 +146,12 @@ namespace SourceGit.Views return; } + if (e.Key == Key.Q) { + App.Quit(0); + 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)) {