mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 06:53:26 +08:00
[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:
parent
d586814308
commit
4ef667dc83
@ -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=""
|
||||
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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user