More coverage for Esc to unselect all items.

This commit is contained in:
Burak Kaan Köse
2025-12-31 11:08:30 +01:00
parent c584929db5
commit d3704a0f09
3 changed files with 18 additions and 1 deletions
@@ -559,6 +559,11 @@ public sealed partial class MailListPage : MailListPageAbstract,
{
await ViewModel.MailCollection.ToggleSelectAllAsync();
}
else if (args.Key == VirtualKey.Escape)
{
// Unselect the selected items.
await ViewModel.MailCollection.UnselectAllAsync();
}
else
{
// Check keyboard shortcuts from service.
@@ -19,6 +19,9 @@
IsDarkEditor="{x:Bind ViewModel.IsDarkWebviewRenderer, Mode=TwoWay}"
mc:Ignorable="d">
<Page.KeyboardAccelerators>
<KeyboardAccelerator Key="Escape" Invoked="EscapeInvoked" />
</Page.KeyboardAccelerators>
<Page.Resources>
<DataTemplate x:Key="InternetAddressTemplate" x:DataType="viewModelData:AccountContactViewModel">
<HyperlinkButton
@@ -472,7 +475,11 @@
<Grid Margin="1" CornerRadius="{ThemeResource OverlayCornerRadius}">
<Grid Background="White" Visibility="{x:Bind IsDarkEditor, Converter={StaticResource ReverseBooleanToVisibilityConverter}, Mode=OneWay}" />
<WebView2 x:Name="Chromium" NavigationStarting="WebViewNavigationStarting" />
<WebView2 x:Name="Chromium" NavigationStarting="WebViewNavigationStarting">
<WebView2.KeyboardAccelerators>
<KeyboardAccelerator Key="Escape" Invoked="EscapeInvoked" />
</WebView2.KeyboardAccelerators>
</WebView2>
<ProgressRing
Width="50"
@@ -342,4 +342,9 @@ public sealed partial class MailRenderingPage : MailRenderingPageAbstract,
WeakReferenceMessenger.Default.Unregister<CancelRenderingContentRequested>(this);
WeakReferenceMessenger.Default.Unregister<ApplicationThemeChanged>(this);
}
private void EscapeInvoked(Microsoft.UI.Xaml.Input.KeyboardAccelerator sender, Microsoft.UI.Xaml.Input.KeyboardAcceleratorInvokedEventArgs args)
{
WeakReferenceMessenger.Default.Send(new ClearMailSelectionsRequested());
}
}