mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
fix: improve screen reader accessibility by naming control containers (#4287)
This commit is contained in:
@@ -31,6 +31,7 @@ function Initialize-InstallCategoryAppList {
|
|||||||
$categoryContainer.Orientation = "Vertical"
|
$categoryContainer.Orientation = "Vertical"
|
||||||
$categoryContainer.Margin = New-Object Windows.Thickness(0, 0, 0, 0)
|
$categoryContainer.Margin = New-Object Windows.Thickness(0, 0, 0, 0)
|
||||||
$categoryContainer.HorizontalAlignment = [Windows.HorizontalAlignment]::Stretch
|
$categoryContainer.HorizontalAlignment = [Windows.HorizontalAlignment]::Stretch
|
||||||
|
[System.Windows.Automation.AutomationProperties]::SetName($categoryContainer, $Category)
|
||||||
|
|
||||||
# Bind Width to the ItemsControl's ActualWidth to force full-row layout in WrapPanel
|
# Bind Width to the ItemsControl's ActualWidth to force full-row layout in WrapPanel
|
||||||
$binding = New-Object Windows.Data.Binding
|
$binding = New-Object Windows.Data.Binding
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ function Invoke-WPFUIElements {
|
|||||||
switch ($entryInfo.Type) {
|
switch ($entryInfo.Type) {
|
||||||
"Toggle" {
|
"Toggle" {
|
||||||
$dockPanel = New-Object Windows.Controls.DockPanel
|
$dockPanel = New-Object Windows.Controls.DockPanel
|
||||||
|
[System.Windows.Automation.AutomationProperties]::SetName($dockPanel, $entryInfo.Content)
|
||||||
$checkBox = New-Object Windows.Controls.CheckBox
|
$checkBox = New-Object Windows.Controls.CheckBox
|
||||||
$checkBox.Name = $entryInfo.Name
|
$checkBox.Name = $entryInfo.Name
|
||||||
$checkBox.HorizontalAlignment = "Right"
|
$checkBox.HorizontalAlignment = "Right"
|
||||||
@@ -241,6 +242,7 @@ function Invoke-WPFUIElements {
|
|||||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||||
$horizontalStackPanel.Orientation = "Horizontal"
|
$horizontalStackPanel.Orientation = "Horizontal"
|
||||||
$horizontalStackPanel.Margin = "0,5,0,0"
|
$horizontalStackPanel.Margin = "0,5,0,0"
|
||||||
|
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
|
||||||
|
|
||||||
$label = New-Object Windows.Controls.Label
|
$label = New-Object Windows.Controls.Label
|
||||||
$label.Content = $entryInfo.Content
|
$label.Content = $entryInfo.Content
|
||||||
@@ -313,6 +315,7 @@ function Invoke-WPFUIElements {
|
|||||||
# Create a StackPanel for this group
|
# Create a StackPanel for this group
|
||||||
$groupStackPanel = New-Object Windows.Controls.StackPanel
|
$groupStackPanel = New-Object Windows.Controls.StackPanel
|
||||||
$groupStackPanel.Orientation = "Vertical"
|
$groupStackPanel.Orientation = "Vertical"
|
||||||
|
[System.Windows.Automation.AutomationProperties]::SetName($groupStackPanel, $entryInfo.GroupName)
|
||||||
|
|
||||||
# Add the group container to the ItemsControl
|
# Add the group container to the ItemsControl
|
||||||
$itemsControl.Items.Add($groupStackPanel) | Out-Null
|
$itemsControl.Items.Add($groupStackPanel) | Out-Null
|
||||||
@@ -346,6 +349,7 @@ function Invoke-WPFUIElements {
|
|||||||
default {
|
default {
|
||||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||||
$horizontalStackPanel.Orientation = "Horizontal"
|
$horizontalStackPanel.Orientation = "Horizontal"
|
||||||
|
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
|
||||||
|
|
||||||
$checkBox = New-Object Windows.Controls.CheckBox
|
$checkBox = New-Object Windows.Controls.CheckBox
|
||||||
$checkBox.Name = $entryInfo.Name
|
$checkBox.Name = $entryInfo.Name
|
||||||
|
|||||||
Reference in New Issue
Block a user