From c6f9701818ad6e40c3ce901501a5bdd51b0e7d5c Mon Sep 17 00:00:00 2001 From: Ani <115020168+drawbyperpetual@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:40:26 +0100 Subject: [PATCH] [Fancy Zones] Fixed accessibility text of monitors on Layout Editor (#36997) Co-authored-by: Stefan Markovic --- .../editor/FancyZonesEditor/MainWindow.xaml | 4 +-- .../Models/MonitorInfoModel.cs | 8 +++++ .../Properties/Resources.Designer.cs | 33 +++++++++++++++++-- .../Properties/Resources.resx | 9 +++++ .../Styles/GridViewStyles.xaml | 4 +-- 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml index 8510511ec6..b4f2cba1a1 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml @@ -83,9 +83,7 @@ + Height="{Binding DisplayHeight}"> diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Models/MonitorInfoModel.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Models/MonitorInfoModel.cs index b3caa48c0e..ec10dd500b 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Models/MonitorInfoModel.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Models/MonitorInfoModel.cs @@ -5,7 +5,9 @@ using System; using System.ComponentModel; using System.Globalization; +using System.Text; +using FancyZonesEditor.Properties; using FancyZonesEditor.ViewModels; namespace FancyZonesEditor.Utils @@ -14,6 +16,8 @@ namespace FancyZonesEditor.Utils { public event PropertyChangedEventHandler PropertyChanged; + private static readonly CompositeFormat MonitorIndexFormat = CompositeFormat.Parse(Resources.Monitor_Index); + public MonitorInfoModel(int index, int height, int width, int dpi, bool selected = false) { Index = index; @@ -24,6 +28,10 @@ namespace FancyZonesEditor.Utils Selected = selected; } + public string AccessibleName => string.Format(CultureInfo.CurrentCulture, MonitorIndexFormat, Index); + + public string AccessibleHelpText => $"{Resources.Dimensions} {Dimensions}, {Resources.Scaling} {Scaling}"; + public int Index { get; set; } public int ScreenBoundsHeight { get; set; } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs index e2dc820a17..8126a15400 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs @@ -276,6 +276,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to Dimensions. + /// + public static string Dimensions { + get { + return ResourceManager.GetString("Dimensions", resourceCulture); + } + } + /// /// Looks up a localized string similar to Highlight distance. /// @@ -539,7 +548,7 @@ namespace FancyZonesEditor.Properties { /// /// Looks up a localized string similar to - ///• [Shift]+S to split currently focused zone. + ///• Shift+S to split currently focused zone. ///• Ctrl+Tab to focus zones/resizers. ///• Tab to cycle zones and resizers. ///• Delete to remove the focused resizer. @@ -554,8 +563,8 @@ namespace FancyZonesEditor.Properties { /// /// Looks up a localized string similar to ///• Ctrl+Tab to switch focus between dialog and zones. - ///• [Shift]+Arrows to resize the focused zone by 10px (5px per edge). - ///• Ctrl+[Shift]+Arrows to resize the focused zone by 2px (1px per edge). + ///• Shift+Arrows to resize the focused zone by 10px (5px per edge). + ///• Ctrl+Shift+Arrows to resize the focused zone by 2px (1px per edge). ///• Arrows to move the focused zone by 10px. ///• Ctrl+Arrows to move the focused zone by 1px.. /// @@ -655,6 +664,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to Monitor {0}. + /// + public static string Monitor_Index { + get { + return ResourceManager.GetString("Monitor_Index", resourceCulture); + } + } + /// /// Looks up a localized string similar to Name. /// @@ -790,6 +808,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to Scaling. + /// + public static string Scaling { + get { + return ResourceManager.GetString("Scaling", resourceCulture); + } + } + /// /// Looks up a localized string similar to Set layout as a default for horizontal monitor orientation. /// diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx index f1b80215b9..c93e4ca459 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx @@ -282,6 +282,15 @@ Monitor + + Monitor {0} + + + Dimensions + + + Scaling + Template settings diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Styles/GridViewStyles.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/Styles/GridViewStyles.xaml index 4d98070f08..a76a649596 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Styles/GridViewStyles.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Styles/GridViewStyles.xaml @@ -26,11 +26,11 @@