Skip to content

Commit

Permalink
Give buttons accessible names (#1962)
Browse files Browse the repository at this point in the history
  • Loading branch information
krschau authored Nov 29, 2023
1 parent 4e41852 commit a5b82d3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions common/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@
<value>Close</value>
<comment>Name of the button that hides the banner</comment>
</data>
<data name="CloseButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Close</value>
<comment>Name of the button that closes a view</comment>
</data>
</root>
7 changes: 4 additions & 3 deletions common/Views/CloseButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Uid="CloseButton"
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
BorderThickness="0"
Background="Transparent"
Padding="10">

<TextBlock FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="{ThemeResource BodyTextBlockFontSize}"
Text="&#xE711;" />
<TextBlock FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="{ThemeResource BodyTextBlockFontSize}"
Text="&#xE711;" />
</Button>
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<value>Pin</value>
<comment>Label for button that pins the widget</comment>
</data>
<data name="PinButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Pin</value>
<comment>Name of the button that pins the widget</comment>
</data>
<data name="UpdateWidgetButton.Content" xml:space="preserve">
<value>Update</value>
<comment>Label for button that updates the widget</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<Grid Grid.Row="2"
x:Name="PinRow">
<Button x:Name="PinButton"
x:Uid="PinButton"
Style="{ThemeResource AccentButtonStyle}"
VerticalAlignment="Bottom" HorizontalAlignment="Center"
Visibility="Collapsed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,8 @@
<value>Extensions Banner</value>
<comment>Name of the Extensions banner for automation</comment>
</data>
<data name="MoreOptionsButton.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>More options</value>
<comment>Name of the button that brings up the "More options" menu</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
<Grid MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,22,0,0">
<StackPanel>
<commonviews:Banner TextWidth="350"
<commonviews:Banner x:Uid="ExtensionsBanner"
TextWidth="350"
Visibility="{x:Bind BannerViewModel.ShowExtensionsBanner,Mode=OneWay}"
HideButtonVisibility="true"
HideButtonCommand="{x:Bind BannerViewModel.HideExtensionsBannerButtonCommand,Mode=OneWay}"
ButtonCommand="{x:Bind BannerViewModel.ExtensionsBannerButtonCommand,Mode=OneWay}"
x:Uid="ExtensionsBanner"
BackgroundSource="{ThemeResource ExtensionsBannerBack}"
OverlaySource="{ThemeResource ExtensionsBannerFront}"
Margin="0,0,0,28" />
Expand All @@ -73,7 +73,8 @@
<ctControls:SettingsExpander.HeaderIcon>
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xea86;"/>
</ctControls:SettingsExpander.HeaderIcon>
<Button Content="&#xe712;"
<Button x:Uid="MoreOptionsButton"
Content="&#xe712;"
Height="36" Width="36"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Background="Transparent"
Expand Down

0 comments on commit a5b82d3

Please sign in to comment.