From 88413285291dd05e6900800fad519efbe459e31d Mon Sep 17 00:00:00 2001 From: Felipe G Date: Mon, 11 Sep 2023 11:20:13 -0700 Subject: [PATCH] Accessibility Improvements on Widgets Dashboard (#1287) * Adding title to the customize window and adding automation properties name to the widget control * added logic for the item status in the size menu flyout * Removing test field * Moving resourceloader instantiation to inside of MarkSize() method instead of passing it * change margin to match add dialog --------- Co-authored-by: Felipe da Conceicao Guimaraes Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com> --- .../DevHome.Dashboard/Controls/WidgetControl.xaml | 3 ++- .../DevHome.Dashboard/Controls/WidgetControl.xaml.cs | 3 +++ .../DevHome.Dashboard/Strings/en-us/Resources.resw | 8 ++++++++ .../DevHome.Dashboard/Views/CustomizeWidgetDialog.xaml | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml b/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml index 7fce2af60b..30fa45f9ef 100644 --- a/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml +++ b/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml @@ -8,7 +8,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:helpers="using:DevHome.Dashboard.Helpers" - mc:Ignorable="d"> + mc:Ignorable="d" + AutomationProperties.Name="{x:Bind WidgetSource.WidgetDisplayTitle}"> diff --git a/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml.cs b/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml.cs index db164da319..1e69a250bf 100644 --- a/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml.cs +++ b/tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml.cs @@ -172,6 +172,7 @@ private async void OnMenuItemSizeClick(object sender, RoutedEventArgs e) if (_currentSelectedSize is not null) { _currentSelectedSize.Icon = null; + _currentSelectedSize.ClearValue(AutomationProperties.ItemStatusProperty); } // Resize widget. @@ -188,11 +189,13 @@ private async void OnMenuItemSizeClick(object sender, RoutedEventArgs e) private void MarkSize(MenuFlyoutItem menuSizeItem) { + var resourceLoader = new ResourceLoader("DevHome.Dashboard.pri", "DevHome.Dashboard/Resources"); var fontIcon = new FontIcon { Glyph = "\xE915", }; menuSizeItem.Icon = fontIcon; + menuSizeItem.SetValue(AutomationProperties.ItemStatusProperty, resourceLoader.GetString("WidgetSizeSelected")); } private void AddCustomizeToWidgetMenu(MenuFlyout widgetMenuFlyout, WidgetViewModel widgetViewModel, ResourceLoader resourceLoader) diff --git a/tools/Dashboard/DevHome.Dashboard/Strings/en-us/Resources.resw b/tools/Dashboard/DevHome.Dashboard/Strings/en-us/Resources.resw index b706f84e0f..640d997e63 100644 --- a/tools/Dashboard/DevHome.Dashboard/Strings/en-us/Resources.resw +++ b/tools/Dashboard/DevHome.Dashboard/Strings/en-us/Resources.resw @@ -158,4 +158,12 @@ Dashboard Banner Name of the dashboard banner for automation + + Customize widget + Title for "Customize" dialog + + + Selected + State of selected size for automatiom purposes + diff --git a/tools/Dashboard/DevHome.Dashboard/Views/CustomizeWidgetDialog.xaml b/tools/Dashboard/DevHome.Dashboard/Views/CustomizeWidgetDialog.xaml index 378df3452c..7c79e99d06 100644 --- a/tools/Dashboard/DevHome.Dashboard/Views/CustomizeWidgetDialog.xaml +++ b/tools/Dashboard/DevHome.Dashboard/Views/CustomizeWidgetDialog.xaml @@ -26,6 +26,7 @@ +