-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Make SUI previews readable by screen readers #18418
Conversation
{ | ||
// the accessible name was not defined, so try to | ||
// extract the value directly from the CurrentValue property | ||
if (const auto currentValText{ currentVal.try_as<hstring>() }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i love this
@@ -103,6 +113,12 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | |||
} | |||
} | |||
|
|||
void SettingContainer::_OnCurrentValueChanged(const Windows::UI::Xaml::DependencyObject& d, const Windows::UI::Xaml::DependencyPropertyChangedEventArgs& /*e*/) | |||
{ | |||
const auto& obj{ d.try_as<Editor::SettingContainer>() }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto& obj{ d.try_as<Editor::SettingContainer>() }; | |
const auto obj{ d.try_as<Editor::SettingContainer>() }; |
not necessary; decays to const auto
anyway
@@ -205,6 +209,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation | |||
} | |||
} | |||
|
|||
winrt::hstring LaunchViewModel::LaunchSizeCurrentValue() const | |||
{ | |||
return winrt::hstring{ fmt::format(FMT_COMPILE(L"{} × {}"), InitialCols(), InitialRows()) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
God, this is very well done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
Summary of the Pull Request
Fixes a few accessibility bugs in the SettingContainer previews. Main changes include:
SettingContainer
was considered a separate UIA element from the inner expander. It's been marked asAccessibilityView=Raw
to "remove" it from the UIA tree.CurrentValueAccessibleName
property to theSettingContainer
to expose the current value to the screen reader forSettingContainer
s that have expanders. Non-expanderSetttingContainer
s already worked fine.CurrentValueAccessibleName
to various settings throughout the settings UI for full coverage. Added aCurrentValue
for the ones that were missing it.Icon
References and Relevant Issues
Padding
was not updated since #18300 is handling that. This'll just automatically make it accessible.Font axes and features weren't updated to show previews, but I'm happy to do it if given a suggestion.
Part of #18318
Detailed Description of the Pull Request / Additional comments
SettingContainer
updates:AccessibilityView = Raw
forSettingContainer
s with expanders. This is because the expander itself is the one we care about. No need to have another layer of UIA objects saying it's a group.CurrentValueAccessibleName
propertyAutomationProperties.Name
CurrentValue
changes.Expander
, if one exists."<Header>: <CurrentValueAccessibleName>"
. IfCurrentValueAccessibleName
isn't provided, we try to use theCurrentValue
if it's a string.Icon
's value is now read out by a screen reader instead of staying silent. It'll read the icon path.Icon
.TabTitle
now displays/reads "None" if no tab title is set.ColorScheme
is now read out by a screen reader.Foreground
,Background
,SelectionBackground
, andCursorColor
) are now read out by a screen reader. Format is "#".BackgroundImageAlignment
is now displayed and read out by a screen reader.LaunchSize
is now displayed and read out by a screen reader. Format is "Width x Height".Validation Steps Performed
Tabbed through the settings UI with a screen reader. Each of these settings now reads out a preview.