mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 14:18: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.Margin = New-Object Windows.Thickness(0, 0, 0, 0)
|
||||
$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
|
||||
$binding = New-Object Windows.Data.Binding
|
||||
|
||||
@@ -157,6 +157,7 @@ function Invoke-WPFUIElements {
|
||||
switch ($entryInfo.Type) {
|
||||
"Toggle" {
|
||||
$dockPanel = New-Object Windows.Controls.DockPanel
|
||||
[System.Windows.Automation.AutomationProperties]::SetName($dockPanel, $entryInfo.Content)
|
||||
$checkBox = New-Object Windows.Controls.CheckBox
|
||||
$checkBox.Name = $entryInfo.Name
|
||||
$checkBox.HorizontalAlignment = "Right"
|
||||
@@ -241,6 +242,7 @@ function Invoke-WPFUIElements {
|
||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||
$horizontalStackPanel.Orientation = "Horizontal"
|
||||
$horizontalStackPanel.Margin = "0,5,0,0"
|
||||
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$label.Content = $entryInfo.Content
|
||||
@@ -313,6 +315,7 @@ function Invoke-WPFUIElements {
|
||||
# Create a StackPanel for this group
|
||||
$groupStackPanel = New-Object Windows.Controls.StackPanel
|
||||
$groupStackPanel.Orientation = "Vertical"
|
||||
[System.Windows.Automation.AutomationProperties]::SetName($groupStackPanel, $entryInfo.GroupName)
|
||||
|
||||
# Add the group container to the ItemsControl
|
||||
$itemsControl.Items.Add($groupStackPanel) | Out-Null
|
||||
@@ -346,6 +349,7 @@ function Invoke-WPFUIElements {
|
||||
default {
|
||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||
$horizontalStackPanel.Orientation = "Horizontal"
|
||||
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
|
||||
|
||||
$checkBox = New-Object Windows.Controls.CheckBox
|
||||
$checkBox.Name = $entryInfo.Name
|
||||
|
||||
Reference in New Issue
Block a user