[FZ Editor] Accessibility fixes (#11097)

* Added tabindex to editor windows

* Hide icons

* Keyboard accesibile dialog

Co-authored-by: Niels Laute <niels9001@hotmail.com>
This commit is contained in:
Niels Laute 2021-05-04 15:36:03 +02:00 committed by GitHub
parent d586814308
commit 4ef667dc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View File

@ -12,7 +12,7 @@
BorderThickness="0"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="True"
ui:TitleBar.IsIconVisible="False"
SizeToContent="Height"
Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize"
@ -45,6 +45,7 @@
FontFamily="Segoe MDL2 Assets"
Content="&#xE109;"
FontSize="24"
TabIndex="0"
ToolTip="{x:Static props:Resources.Add_zone}"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsEnabled="{Binding IsZoneAddingAllowed}"
@ -60,9 +61,11 @@
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Stretch"
Grid.Column="2"
TabIndex="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1"
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" />
</Grid>

View File

@ -12,7 +12,7 @@
BorderThickness="0"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="True"
ui:TitleBar.IsIconVisible="False"
SizeToContent="Height"
Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize"
@ -61,10 +61,12 @@
<Button Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Stretch"
TabIndex="1"
Grid.Column="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0"
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" />
</Grid>

View File

@ -158,7 +158,8 @@
Visibility="{Binding Path=Type, Converter={StaticResource LayoutModelTypeBlankToVisibilityConverter}}"
Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}}"
ToolTip="{x:Static props:Resources.Edit}"
AutomationProperties.Name="{x:Static props:Resources.Edit}"
AutomationProperties.HelpText="{x:Static props:Resources.Edit}"
AutomationProperties.Name="{Binding Name}"
Style="{StaticResource AccentButtonStyle}"
ui:ControlHelper.CornerRadius="36" />
</Grid>
@ -422,6 +423,7 @@
AutomationProperties.HelpText="{x:Static props:Resources.QuickKey_Description}"
AutomationProperties.Name="{x:Static props:Resources.QuickKey_Title}"
ItemsSource="{Binding QuickKeysAvailable}"
KeyDown="ComboBox_KeyDown"
SelectedItem="{Binding QuickKey}" />
</StackPanel>
@ -472,6 +474,7 @@
KeyDown="EditDialogNumberBox_KeyDown"
Margin="12,0,0,0"
Header="{x:Static props:Resources.Number_of_zones}"
AutomationProperties.Name="{x:Static props:Resources.Number_of_zones}"
SpinButtonPlacementMode="Compact"
Text="{Binding TemplateZoneCount}" />
</StackPanel>

View File

@ -423,5 +423,18 @@ namespace FancyZonesEditor
{
monitorViewModel.SelectCommand.Execute(e.ClickedItem as MonitorInfoModel);
}
private void ComboBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter || e.Key == Key.Space)
{
e.Handled = true;
ComboBox selectedComboBox = sender as ComboBox;
if (!selectedComboBox.IsDropDownOpen)
{
selectedComboBox.IsDropDownOpen = true;
}
}
}
}
}