Skip to content

Commit a3d1f78

Browse files
committed
Exit on Ctrl+Q
1 parent d797194 commit a3d1f78

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/Views/Hotkeys.axaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}"
4646
Margin="0,0,0,8"/>
4747

48-
<Grid RowDefinitions="20,20,20,20,20,20,20" ColumnDefinitions="150,*">
48+
<Grid RowDefinitions="20,20,20,20,20,20,20,20" ColumnDefinitions="150,*">
4949
<TextBlock Grid.Row="0" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Shift+P, macOS=⌘+\,}"/>
5050
<TextBlock Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.OpenPreference}"/>
5151

@@ -66,6 +66,9 @@
6666

6767
<TextBlock Grid.Row="6" Grid.Column="0" Classes="primary bold" Text="ESC"/>
6868
<TextBlock Grid.Row="6" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.CancelPopup}" />
69+
70+
<TextBlock Grid.Row="7" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Q, macOS=⌘+Q}"/>
71+
<TextBlock Grid.Row="7" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Quit}" />
6972
</Grid>
7073

7174
<TextBlock Text="{DynamicResource Text.Hotkeys.Repo}"

src/Views/Launcher.axaml

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}"/>
6363
</MenuItem.Icon>
6464
</MenuItem>
65+
<MenuItem Header="{DynamicResource Text.Quit}" Command="{x:Static s:App.QuitCommand}" InputGesture="Ctrl+Q"/>
6566
</MenuFlyout>
6667
</Button.Flyout>
6768
<Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>

src/Views/Launcher.axaml.cs

+6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ protected override void OnKeyDown(KeyEventArgs e)
146146
return;
147147
}
148148

149+
if (e.Key == Key.Q) {
150+
App.Quit(0);
151+
e.Handled = true;
152+
return;
153+
}
154+
149155
if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) ||
150156
(!OperatingSystem.IsMacOS() && !e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab))
151157
{

0 commit comments

Comments
 (0)