mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Enable keyboard accessibility for template and custom layout items (#7977)
This commit is contained in:
@@ -84,6 +84,21 @@ namespace FancyZonesEditor
|
||||
Select(((Border)sender).DataContext as LayoutModel);
|
||||
}
|
||||
|
||||
private void LayoutItem_Focused(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Select(((Border)sender).DataContext as LayoutModel);
|
||||
}
|
||||
|
||||
private void LayoutItem_Apply(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Return || e.Key == Key.Space)
|
||||
{
|
||||
// When certain layout item (template or custom) is focused through keyboard and user
|
||||
// presses Enter or Space key, layout will be applied.
|
||||
Apply();
|
||||
}
|
||||
}
|
||||
|
||||
private void Select(LayoutModel newSelection)
|
||||
{
|
||||
if (EditorOverlay.Current.DataContext is LayoutModel currentSelection)
|
||||
@@ -154,6 +169,11 @@ namespace FancyZonesEditor
|
||||
}
|
||||
|
||||
private void Apply_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Apply();
|
||||
}
|
||||
|
||||
private void Apply()
|
||||
{
|
||||
EditorOverlay mainEditor = EditorOverlay.Current;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user