From 59010c3a292df9c584e941f7198a4896ac367841 Mon Sep 17 00:00:00 2001 From: Vladimir Eremeev Date: Sun, 5 Jan 2025 13:06:02 +0300 Subject: [PATCH] Exit on Ctrl+Q --- 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)) {