Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fancy Zones] Fixed accessibility text of monitors on Layout Editor #36997

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@
<Border
x:Name="MonitorItem"
Width="{Binding DisplayWidth}"
Height="{Binding DisplayHeight}"
AutomationProperties.HelpText="{Binding Index}"
AutomationProperties.Name="{x:Static props:Resources.Monitor}">
Height="{Binding DisplayHeight}">
<Border.ToolTip>
<ToolTip>
<StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using System;
using System.ComponentModel;
using System.Globalization;
using System.Text;

using FancyZonesEditor.Properties;
using FancyZonesEditor.ViewModels;

namespace FancyZonesEditor.Utils
Expand All @@ -14,6 +16,8 @@ public class MonitorInfoModel : INotifyPropertyChanged
{
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;
Expand All @@ -24,6 +28,10 @@ public MonitorInfoModel(int index, int height, int width, int dpi, bool selected
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; }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@
<data name="Monitor" xml:space="preserve">
<value>Monitor</value>
</data>
<data name="Monitor_Index" xml:space="preserve">
<value>Monitor {0}</value>
</data>
<data name="Dimensions" xml:space="preserve">
<value>Dimensions</value>
</data>
<data name="Scaling" xml:space="preserve">
<value>Scaling</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Template settings</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
<Style x:Key="MonitorItemContainerStyle" TargetType="ui:GridViewItem">
<Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Index}" />
<Setter Property="AutomationProperties.Name" Value="{Binding AccessibleName}" />
<Setter Property="AutomationProperties.HelpText" Value="{Binding AccessibleHelpText}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<!--<Setter Property="IsHoldingEnabled" Value="True" />-->
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Margin" Value="8" />
<Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
Expand Down
Loading