Skip to content

Commit

Permalink
Exit on Ctrl+Q
Browse files Browse the repository at this point in the history
  • Loading branch information
wl2776 committed Jan 11, 2025
1 parent c132fe6 commit 6234050
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Views/Hotkeys.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}"
Margin="0,0,0,8"/>

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

Expand All @@ -66,6 +66,9 @@

<TextBlock Grid.Row="6" Grid.Column="0" Classes="primary bold" Text="ESC"/>
<TextBlock Grid.Row="6" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Hotkeys.Global.CancelPopup}" />

<TextBlock Grid.Row="7" Grid.Column="0" Classes="primary bold" Text="{OnPlatform Ctrl+Q, macOS=⌘+Q}"/>
<TextBlock Grid.Row="7" Grid.Column="1" Margin="16,0,0,0" Text="{DynamicResource Text.Quit}" />
</Grid>

<TextBlock Text="{DynamicResource Text.Hotkeys.Repo}"
Expand Down
1 change: 1 addition & 0 deletions src/Views/Launcher.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource Text.Quit}" Command="{x:Static s:App.QuitCommand}" InputGesture="Ctrl+Q"/>
</MenuFlyout>
</Button.Flyout>
<Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>
Expand Down
6 changes: 6 additions & 0 deletions src/Views/Launcher.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ protected override void OnKeyDown(KeyEventArgs e)
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))
{
Expand Down

0 comments on commit 6234050

Please sign in to comment.