[Settings] A11y fixes (#13533)

* Added support for headers narrator announcement

* Added name to info button

* Added tabstop support to Infobars

* Adding TabStop

* Added headinglevels

* Replace radiobuttons with combobox

* Revert "Replace radiobuttons with combobox"

This reverts commit 4e57795409.

Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
Niels Laute
2021-10-01 15:11:09 +02:00
committed by GitHub
parent b0d35f5ef8
commit d646edee08
11 changed files with 54 additions and 6 deletions

View File

@@ -28,7 +28,7 @@
<TextBlock x:Name="TitleTxt"
Text="{x:Bind ModuleTitle}"
AutomationProperties.HeadingLevel="Level2"
AutomationProperties.HeadingLevel="Level1"
Style="{StaticResource TitleTextBlockStyle}" />
<TextBlock x:Name="DescriptionTxt"

View File

@@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Controls
@@ -55,5 +56,10 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
{
VisualStateManager.GoToState(this, IsEnabled ? "Normal" : "Disabled", true);
}
protected override AutomationPeer OnCreateAutomationPeer()
{
return new SettingsGroupAutomationPeer(this);
}
}
}

View File

@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Windows.UI.Xaml.Automation.Peers;
namespace Microsoft.PowerToys.Settings.UI.Controls
{
public class SettingsGroupAutomationPeer : FrameworkElementAutomationPeer
{
public SettingsGroupAutomationPeer(SettingsGroup owner)
: base(owner)
{
}
protected override string GetNameCore()
{
var selectedSettingsGroup = (SettingsGroup)Owner;
return selectedSettingsGroup.Header;
}
}
}

View File

@@ -21,6 +21,7 @@
<TextBlock x:Name="Header"
Text="{x:Bind ModuleTitle}"
AutomationProperties.HeadingLevel="1"
Style="{StaticResource TitleTextBlockStyle}"
Margin="0,44,0,0"
VerticalAlignment="Stretch"/>
@@ -58,7 +59,7 @@
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap"/>
<ItemsControl ItemsSource="{x:Bind PrimaryLinks}" Margin="0,8,0,0">
<ItemsControl ItemsSource="{x:Bind PrimaryLinks}" IsTabStop="False" Margin="0,8,0,0">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="local:PageLink">
<HyperlinkButton NavigateUri="{x:Bind Link}" Style="{StaticResource TextButtonStyle}">
@@ -94,7 +95,7 @@
Margin="2,8,0,0"
AutomationProperties.HeadingLevel="Level2"/>
<ItemsControl x:Name="SecondaryLinksItemControl" Margin="2,0,0,0" ItemsSource="{x:Bind SecondaryLinks}">
<ItemsControl x:Name="SecondaryLinksItemControl" IsTabStop="False" Margin="2,0,0,0" ItemsSource="{x:Bind SecondaryLinks}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="local:PageLink">
<HyperlinkButton NavigateUri="{x:Bind Link}" Style="{StaticResource TextButtonStyle}">

View File

@@ -95,6 +95,7 @@
</Compile>
<Compile Include="Behaviors\NavigationViewHeaderBehavior.cs" />
<Compile Include="Behaviors\NavigationViewHeaderMode.cs" />
<Compile Include="Controls\SettingsGroup\SettingsGroupAutomationPeer.cs" />
<Compile Include="Controls\ShortcutControl\ShortcutControl.xaml.cs">
<DependentUpon>ShortcutControl.xaml</DependentUpon>
</Compile>
@@ -105,7 +106,7 @@
<Compile Include="Controls\ShortcutControl\ShortcutDialogContentControl.xaml.cs">
<DependentUpon>ShortcutDialogContentControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\ShortcutControl\ShortcutWithTextLabelControl.xaml.cs">
<Compile Include="Controls\ShortcutControl\ShortcutWithTextLabelControl.xaml.cs">
<DependentUpon>ShortcutWithTextLabelControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\SettingsPageControl\SettingsPageControl.xaml.cs">

View File

@@ -963,6 +963,9 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve">
<value>Example: %1 (%2)</value>
</data>
<data name="ImageResizer_FilenameParameters.AutomationProperties.Name" xml:space="preserve">
<value>Filename parameters</value>
</data>
<data name="ColorModeHeader.Header" xml:space="preserve">
<value>App theme</value>
</data>

View File

@@ -61,12 +61,14 @@
<muxc:InfoBar x:Uid="General_UpToDate"
IsClosable="False"
Severity="Success"
IsTabStop="True"
IsOpen="{Binding IsNewVersionCheckedAndUpToDate, Mode=OneWay}"/>
<!-- New version available -->
<muxc:InfoBar x:Uid="General_NewVersionAvailable"
IsClosable="False"
Severity="Informational"
IsTabStop="True"
IsOpen="{Binding PowerToysUpdatingState, Mode=OneWay, Converter={StaticResource UpdateStateToBoolConverter}, ConverterParameter=ReadyToDownload}"
Message="{Binding PowerToysNewAvailableVersion, Mode=OneWay}">
<muxc:InfoBar.Content>
@@ -102,6 +104,7 @@
<muxc:InfoBar x:Uid="General_NewVersionReadyToInstall"
IsClosable="False"
Severity="Success"
IsTabStop="True"
IsOpen="{Binding PowerToysUpdatingState, Mode=OneWay, Converter={StaticResource UpdateStateToBoolConverter}, ConverterParameter=ReadyToInstall}"
Message="{Binding PowerToysNewAvailableVersion}">
<muxc:InfoBar.Content>
@@ -126,6 +129,7 @@
<muxc:InfoBar x:Uid="General_FailedToDownloadTheNewVersion"
IsClosable="False"
Severity="Error"
IsTabStop="True"
IsOpen="{Binding PowerToysUpdatingState, Mode=OneWay, Converter={StaticResource UpdateStateToBoolConverter}, ConverterParameter=ErrorDownloading}"
Message="{Binding PowerToysNewAvailableVersion}">
<muxc:InfoBar.Content>
@@ -192,6 +196,7 @@
</controls:Setting>
<muxc:InfoBar x:Uid="General_RunAsAdminRequired"
Severity="Warning"
IsTabStop="True"
IsClosable="False"
IsOpen="{Binding Mode=OneWay, Path=IsElevated, Converter={StaticResource NegationConverter}}"/>
</StackPanel>

View File

@@ -226,7 +226,7 @@
HorizontalAlignment="Right"
MinWidth="{StaticResource SettingActionControlMinWidth}"
x:Uid="ImageResizer_FilenameFormatPlaceholder"/>
<Button Content="&#xE946;" Height="32" FontFamily="{ThemeResource SymbolThemeFontFamily}">
<Button Content="&#xE946;" x:Uid="ImageResizer_FilenameParameters" Height="32" FontFamily="{ThemeResource SymbolThemeFontFamily}">
<Button.Flyout>
<Flyout>
<TextBlock x:Name="FileFormatTextBlock">

View File

@@ -167,7 +167,11 @@
</AutoSuggestBox>
</controls:Setting.ActionContent>
</controls:Setting>
<muxc:InfoBar x:Uid="Run_AllPluginsDisabled" Severity="Error" IsOpen="{x:Bind ViewModel.ShowAllPluginsDisabledWarning, Mode=OneWay}" IsClosable="False" />
<muxc:InfoBar x:Uid="Run_AllPluginsDisabled"
Severity="Error"
IsTabStop="True"
IsOpen="{x:Bind ViewModel.ShowAllPluginsDisabledWarning, Mode=OneWay}"
IsClosable="False" />
<StackPanel Orientation="Horizontal" Visibility="{x:Bind ViewModel.ShowPluginsLoadingMessage, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
<muxc:ProgressRing IsActive="True" Width="20" Height="20" Margin="18,18" />
@@ -212,10 +216,12 @@
</controls:Setting.ActionContent>
</controls:Setting>
<muxc:InfoBar Severity="Error" x:Uid="Run_NotAccessibleWarning"
IsTabStop="True"
IsOpen="{x:Bind ShowNotAccessibleWarning}"
IsClosable="False" />
<muxc:InfoBar Severity="Error"
x:Uid="Run_NotAllowedActionKeyword"
IsTabStop="True"
IsOpen="{x:Bind ShowNotAllowedKeywordWarning}"
IsClosable="False" />
<Rectangle Style="{StaticResource ExpanderSeparatorStyle}" />

View File

@@ -23,12 +23,14 @@
<muxc:InfoBar Severity="Warning"
x:Uid="FileExplorerPreview_RunAsAdminRequired"
IsOpen="True"
IsTabStop="True"
IsClosable="False"
Visibility="{Binding Mode=OneWay, Path=IsElevated, Converter={StaticResource BoolToVisibilityConverter}}" />
<muxc:InfoBar Severity="Informational"
x:Uid="FileExplorerPreview_AffectsAllUsers"
IsOpen="True"
IsTabStop="True"
IsClosable="False"
/>
@@ -59,6 +61,7 @@
<muxc:InfoBar Severity="Informational"
x:Uid="FileExplorerPreview_RebootRequired"
IsOpen="True"
IsTabStop="True"
IsClosable="False"
/>
<controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_SVG_Thumbnail" Icon="&#xE91B;">

View File

@@ -65,6 +65,7 @@
<muxc:InfoBar
x:Uid="ShortcutGuide_PressWinKeyWarning"
Severity="Warning"
IsTabStop="True"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior}"
IsClosable="False"
/>