Skip to content

Commit 8d265a2

Browse files
committed
Exit on Ctrl+Q
1 parent 4b615fd commit 8d265a2

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

‎src/Views/Hotkeys.axaml‎

Lines changed: 4 additions & 1 deletion
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-
<GridRowDefinitions="20,20,20,20,20,20,20"ColumnDefinitions="150,*">
48+
<GridRowDefinitions="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
<TextBlockText="{DynamicResource Text.Hotkeys.Repo}"

‎src/Views/Launcher.axaml‎

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

‎src/Views/Launcher.axaml.cs‎

Lines changed: 6 additions & 0 deletions
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)