From 3ea0a10c73ff0c68459d13e69c470203f97ca588 Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Tue, 5 Apr 2022 13:22:17 +0100 Subject: [PATCH] [FZEditor] Improve narrator support on Grid Editor (#17532) * [FZEditor]Add narrator info to thumb buttons * [FZEditor]Narrator information about the zones * [FZEditor]Allow text to be focused for narrator * Address PR feedback --- .../FancyZonesEditor/GridEditorWindow.xaml | 5 ++- .../editor/FancyZonesEditor/GridResizer.xaml | 2 + .../editor/FancyZonesEditor/GridZone.xaml.cs | 7 ++++ .../Properties/Resources.Designer.cs | 42 ++++++++++++++++++- .../Properties/Resources.resx | 16 +++++++ 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml index 4d603b163f..0213518bc0 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/GridEditorWindow.xaml @@ -37,7 +37,8 @@ - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/GridZone.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/GridZone.xaml.cs index 7c37519a27..358443824b 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/GridZone.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/GridZone.xaml.cs @@ -112,6 +112,13 @@ namespace FancyZonesEditor // using current culture as this is end user facing WidthLabel.Text = Math.Round(ActualWidth).ToString(CultureInfo.CurrentCulture); HeightLabel.Text = Math.Round(ActualHeight).ToString(CultureInfo.CurrentCulture); + System.Windows.Automation.AutomationProperties.SetName( + this, +#pragma warning disable SA1118 // Parameter should not span multiple lines + Properties.Resources.Zone_Name + " " + (_zone.Index + 1).ToString(CultureInfo.CurrentCulture) + ". " + + Properties.Resources.Width_Name + ": " + WidthLabel.Text + ", " + + Properties.Resources.Height_Name + ": " + HeightLabel.Text); +#pragma warning restore SA1118 // Parameter should not span multiple lines } public void UpdateShiftState(bool shiftState) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs index 6d55120876..991da47b96 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs @@ -239,7 +239,47 @@ namespace FancyZonesEditor.Properties { return ResourceManager.GetString("Delete_Layout_Dialog_Announce", resourceCulture); } } - + + /// + /// Looks up a localized string for representing the names of a single zone. + /// + public static string Zone_Name { + get + { + return ResourceManager.GetString("Zone_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string for representing the name of the width dimension. + /// + public static string Width_Name { + get + { + return ResourceManager.GetString("Width_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string for representing the name of the height dimension. + /// + public static string Height_Name { + get + { + return ResourceManager.GetString("Height_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string for explaining how to use the thumbs to resize zone. + /// + public static string Resizer_Thumb_Announce { + get + { + return ResourceManager.GetString("Resizer_Thumb_Announce", resourceCulture); + } + } + /// /// Looks up a localized string similar to Delete zone. /// diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx index a353b38b90..1a678737f9 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx @@ -288,6 +288,22 @@ Delete layout dialog. + + Zone + The name of the zones. + + + Width + The name of dimension called width. + + + Height + The name of dimension called height. + + + Use the arrow keys to resize, delete key to remove. + Keys and key means the keyboard keys. + Are you sure?