Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Settings] A11y fixes #13533

Merged
merged 7 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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
Expand Down Expand Up @@ -55,5 +56,10 @@ private void SetEnabledState()
{
VisualStateManager.GoToState(this, IsEnabled ? "Normal" : "Disabled", true);
}

protected override AutomationPeer OnCreateAutomationPeer()
{
return new SettingsGroupAutomationPeer(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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}">
Expand Down Expand Up @@ -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}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down Expand Up @@ -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}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>

Expand Down Expand Up @@ -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;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<muxc:InfoBar
x:Uid="ShortcutGuide_PressWinKeyWarning"
Severity="Warning"
IsTabStop="True"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior}"
IsClosable="False"
/>
Expand Down