Skip to content

Commit b1572ee

Browse files
authored
P1 Accessibility Fixes (microsoft#1380)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> Miscellaneous p1 accessibility fixes: - [Bug 44661786](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/44661786): [WinUI Accessibility: Design guidance -> Accessibility-> Keyboard support]: Screen reader is announcing incorrect information about the shortcuts. - [Bug 46762667](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46762667): [WinUI 3 Gallery: Item View]: Screen reader fails to announce the label for the radio buttons present in under 'Layout' group. - [Bug 46763238](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46763238): [WinUI 3 Gallery: Progress Ring]: Accessibility name and visual name is not same for working toggle button present under 'Toggle Work' group. - [Bug 46818786](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46818786): [WinUI 3 Gallery: Clipboard]: Screen reader is not announcing the success message after activating the 'Copy Text to the Clipboard' button. - [Bug 46818852](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46818852): [WinUI 3 Gallery: FilePicker]: Screen reader is not announcing the success message after activating the 'Open a file/Open a picture/Save a file' button. - [Bug 46820249](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46820249): [WinUI 3 Gallery: Design Guidance: Color]: Upon invoking 'Copy brush name' button screen reader is on mute and there is no visual changes. - [Bug 46820807](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46820807): [WinUI 3 Gallery: Typography]: Some parts of right side of the screen is getting truncated in High DPI mode also not having scroll bar to scroll towards right. - [Bug 46821911](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46821911): [WinUI 3 Gallery: List View]: Text present beside the images which present under 'List view with image' heading is getting truncated in normal mode. - [Bug 46825231](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/46825231): [WinUI 3 Gallery: Connected Animation]: Text present beside the images which present in 'Connected Animation' card is getting truncated in normal mode. - [Bug 41570653](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/41570653): [WinUI Accessibility-> Left Navigation Pane]: No success information announced by screen reader, when user invokes open/close navigation button. - [Bug 41597549](https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/41597549): [WinUI Gallery] WinUI Accessibility-> TeachingTip: Unable to navigate to the image present in "Quickly reference this sample!" dialog using caps arrow keys. ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change)
1 parent 9a2c60b commit b1572ee

15 files changed

Lines changed: 268 additions & 198 deletions

WinUIGallery/ConnectedAnimationPages/CollectionPage.xaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Page
1+
<Page
22
x:Class="AppUIBasics.ConnectedAnimationPages.CollectionPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -30,13 +30,12 @@
3030
<StackPanel Orientation="Horizontal">
3131
<TextBlock Text="Views: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold"/>
3232
<TextBlock Text="{x:Bind Views}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/>
33-
</StackPanel>
34-
<StackPanel Orientation="Horizontal">
35-
<TextBlock Text="Likes: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold"/>
33+
34+
<TextBlock Text="Likes: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold" Margin="8,0,0,0"/>
3635
<TextBlock Text="{x:Bind Likes}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/>
3736
</StackPanel>
3837
<StackPanel Orientation="Horizontal">
39-
<TextBlock Text="{x:Bind Description}" Style="{ThemeResource BodyTextBlockStyle}" FontStyle="Italic" Margin="0,12,0,0" TextTrimming="CharacterEllipsis" MaxWidth="500" MaxLines="1"/>
38+
<TextBlock Text="{x:Bind Description}" Style="{ThemeResource BodyTextBlockStyle}" FontStyle="Italic" Margin="0,8,0,0" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxWidth="500" MaxHeight="40" IsTextTrimmedChanged="TextBlock_IsTextTrimmedChanged"/>
4039
</StackPanel>
4140

4241
</StackPanel>

WinUIGallery/ConnectedAnimationPages/CollectionPage.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,12 @@ private void collection_ItemClick(object sender, ItemClickEventArgs e)
6767
Frame.Navigate(typeof(DetailedInfoPage), _storeditem, new SuppressNavigationTransitionInfo());
6868
}
6969

70+
private void TextBlock_IsTextTrimmedChanged(TextBlock sender, IsTextTrimmedChangedEventArgs args)
71+
{
72+
var textBlock = sender as TextBlock;
73+
var text = textBlock.IsTextTrimmed ? textBlock.Text : string.Empty;
74+
75+
ToolTipService.SetToolTip(textBlock, text);
76+
}
7077
}
7178
}

WinUIGallery/ControlPages/ClipboardPage.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Threading.Tasks;
33
using System.Xml.Linq;
4+
using AppUIBasics.Helper;
45
using Microsoft.UI.Xaml;
56
using Microsoft.UI.Xaml.Controls;
67
using Windows.ApplicationModel.DataTransfer;
@@ -26,6 +27,8 @@ private void CopyText_Click(object sender, RoutedEventArgs args)
2627
package.SetText(textToCopy);
2728
Clipboard.SetContent(package);
2829

30+
UIHelper.AnnounceActionForAccessibility(sender as Button, "Text copied to clipboard", "TextCopiedSuccessNotificationId");
31+
2932
VisualStateManager.GoToState(this, "ConfirmationClipboardVisible", false);
3033
Microsoft.UI.Dispatching.DispatcherQueue dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
3134

@@ -48,6 +51,8 @@ private async void PasteText_Click(object sender, RoutedEventArgs args)
4851
{
4952
var text = await package.GetTextAsync();
5053
PasteClipboard2.Text = text;
54+
55+
UIHelper.AnnounceActionForAccessibility(sender as Button, "Text pasted from clipboard", "TextPastedSuccessNotificationId");
5156
}
5257

5358
}

WinUIGallery/ControlPages/DesignGuidance/AccessibilityKeyboardPage.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
<Button
471471
Grid.Row="1"
472472
Click="MakeRedButton_Click"
473+
AutomationProperties.AcceleratorKey="Ctrl+R"
473474
Content="Red">
474475
<Button.KeyboardAccelerators>
475476
<KeyboardAccelerator Key="R" Modifiers="Control" />
@@ -480,6 +481,7 @@
480481
Grid.Row="1"
481482
Grid.Column="1"
482483
Click="MakeBlueButton_Click"
484+
AutomationProperties.AcceleratorKey="Ctrl+B"
483485
Content="Blue">
484486
<Button.KeyboardAccelerators>
485487
<KeyboardAccelerator Key="B" Modifiers="Control" />
@@ -496,6 +498,7 @@
496498
Grid.Column="2"
497499
Click="MakeChartreuseButton_Click"
498500
Content="Chartreuse"
501+
AutomationProperties.AcceleratorKey="Ctrl+G"
499502
ToolTipService.ToolTip="A greenish-yellow (Ctrl+G)">
500503
<Button.KeyboardAccelerators>
501504
<KeyboardAccelerator Key="G" Modifiers="Control" />

WinUIGallery/ControlPages/DesignGuidance/IconsPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
Spacing="8">
157157
<TextBlock Style="{ThemeResource BodyStrongTextBlockStyle}" Text="Fluent Icons Library" />
158158
<AutoSuggestBox
159+
x:Name="IconsAutoSuggestBox"
159160
MinWidth="304"
160161
MaxWidth="320"
161162
HorizontalAlignment="Left"

WinUIGallery/ControlPages/DesignGuidance/IconsPage.xaml.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Collections.ObjectModel;
1414
using System.Linq;
1515
using System.Threading.Tasks;
16+
using AppUIBasics.Helper;
1617
using Microsoft.UI.Xaml;
1718
using Microsoft.UI.Xaml.Controls;
1819
using Microsoft.UI.Xaml.Input;
@@ -93,10 +94,21 @@ public void Filter(string search)
9394
FilteredItems.Add(item);
9495
}
9596
}
96-
if (FilteredItems.Count > 0)
97+
98+
string outputString;
99+
var filteredItemsCount = FilteredItems.Count;
100+
101+
if (filteredItemsCount > 0)
97102
{
98103
SelectedItem = FilteredItems[0];
104+
outputString = filteredItemsCount > 1 ? filteredItemsCount + " icons found." : "1 icon found.";
99105
}
106+
else
107+
{
108+
outputString = "No icon found.";
109+
}
110+
111+
UIHelper.AnnounceActionForAccessibility(IconsAutoSuggestBox, outputString, "AutoSuggestBoxNumberIconsFoundId");
100112
}
101113

102114
private void Icons_TemplatePointerPressed(object sender, PointerRoutedEventArgs e)

0 commit comments

Comments
 (0)