Skip to content

Commit

Permalink
P1 Accessibility Fixes (microsoft#1380)
Browse files Browse the repository at this point in the history
<!--- 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)
  • Loading branch information
karkarl committed Oct 11, 2023
1 parent 9a2c60b commit b1572ee
Show file tree
Hide file tree
Showing 15 changed files with 268 additions and 198 deletions.
9 changes: 4 additions & 5 deletions WinUIGallery/ConnectedAnimationPages/CollectionPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Page
<Page
x:Class="AppUIBasics.ConnectedAnimationPages.CollectionPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -30,13 +30,12 @@
<StackPanel Orientation="Horizontal">
<TextBlock Text="Views: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold"/>
<TextBlock Text="{x:Bind Views}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Likes: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold"/>

<TextBlock Text="Likes: " Style="{ThemeResource CaptionTextBlockStyle}" FontWeight="Bold" Margin="8,0,0,0"/>
<TextBlock Text="{x:Bind Likes}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Bind Description}" Style="{ThemeResource BodyTextBlockStyle}" FontStyle="Italic" Margin="0,12,0,0" TextTrimming="CharacterEllipsis" MaxWidth="500" MaxLines="1"/>
<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"/>
</StackPanel>

</StackPanel>
Expand Down
7 changes: 7 additions & 0 deletions WinUIGallery/ConnectedAnimationPages/CollectionPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,12 @@ private void collection_ItemClick(object sender, ItemClickEventArgs e)
Frame.Navigate(typeof(DetailedInfoPage), _storeditem, new SuppressNavigationTransitionInfo());
}

private void TextBlock_IsTextTrimmedChanged(TextBlock sender, IsTextTrimmedChangedEventArgs args)
{
var textBlock = sender as TextBlock;
var text = textBlock.IsTextTrimmed ? textBlock.Text : string.Empty;

ToolTipService.SetToolTip(textBlock, text);
}
}
}
5 changes: 5 additions & 0 deletions WinUIGallery/ControlPages/ClipboardPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using System.Xml.Linq;
using AppUIBasics.Helper;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Windows.ApplicationModel.DataTransfer;
Expand All @@ -26,6 +27,8 @@ private void CopyText_Click(object sender, RoutedEventArgs args)
package.SetText(textToCopy);
Clipboard.SetContent(package);

UIHelper.AnnounceActionForAccessibility(sender as Button, "Text copied to clipboard", "TextCopiedSuccessNotificationId");

VisualStateManager.GoToState(this, "ConfirmationClipboardVisible", false);
Microsoft.UI.Dispatching.DispatcherQueue dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();

Expand All @@ -48,6 +51,8 @@ private async void PasteText_Click(object sender, RoutedEventArgs args)
{
var text = await package.GetTextAsync();
PasteClipboard2.Text = text;

UIHelper.AnnounceActionForAccessibility(sender as Button, "Text pasted from clipboard", "TextPastedSuccessNotificationId");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
<Button
Grid.Row="1"
Click="MakeRedButton_Click"
AutomationProperties.AcceleratorKey="Ctrl+R"
Content="Red">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="R" Modifiers="Control" />
Expand All @@ -480,6 +481,7 @@
Grid.Row="1"
Grid.Column="1"
Click="MakeBlueButton_Click"
AutomationProperties.AcceleratorKey="Ctrl+B"
Content="Blue">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="B" Modifiers="Control" />
Expand All @@ -496,6 +498,7 @@
Grid.Column="2"
Click="MakeChartreuseButton_Click"
Content="Chartreuse"
AutomationProperties.AcceleratorKey="Ctrl+G"
ToolTipService.ToolTip="A greenish-yellow (Ctrl+G)">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="G" Modifiers="Control" />
Expand Down
1 change: 1 addition & 0 deletions WinUIGallery/ControlPages/DesignGuidance/IconsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
Spacing="8">
<TextBlock Style="{ThemeResource BodyStrongTextBlockStyle}" Text="Fluent Icons Library" />
<AutoSuggestBox
x:Name="IconsAutoSuggestBox"
MinWidth="304"
MaxWidth="320"
HorizontalAlignment="Left"
Expand Down
14 changes: 13 additions & 1 deletion WinUIGallery/ControlPages/DesignGuidance/IconsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using AppUIBasics.Helper;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
Expand Down Expand Up @@ -93,10 +94,21 @@ public void Filter(string search)
FilteredItems.Add(item);
}
}
if (FilteredItems.Count > 0)

string outputString;
var filteredItemsCount = FilteredItems.Count;

if (filteredItemsCount > 0)
{
SelectedItem = FilteredItems[0];
outputString = filteredItemsCount > 1 ? filteredItemsCount + " icons found." : "1 icon found.";
}
else
{
outputString = "No icon found.";
}

UIHelper.AnnounceActionForAccessibility(IconsAutoSuggestBox, outputString, "AutoSuggestBoxNumberIconsFoundId");
}

private void Icons_TemplatePointerPressed(object sender, PointerRoutedEventArgs e)
Expand Down

0 comments on commit b1572ee

Please sign in to comment.