From c25cd5c9c7a693b035e5b473464cc8a68e1b177f Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 11 Oct 2022 16:17:54 -0700 Subject: [PATCH] Make SUI breadcrumb readable by screen readers (#14180) The breadcrumbs in the SUI were not readable by screen readers because they are represented as a button with a text block inside of it. Turns out, if you make the DataTemplate's item `IStringable` (meaning it has a `ToString()`), it all magically works! Allowing the screen reader to read the button as text. Closes #13826 (cherry picked from commit 30046dd4a7216a704de01d1b13bd5a83d29d0e98) Service-Card-Id: 86158951 Service-Version: 1.15 --- src/cascadia/TerminalSettingsEditor/MainPage.h | 2 ++ src/cascadia/TerminalSettingsEditor/MainPage.idl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.h b/src/cascadia/TerminalSettingsEditor/MainPage.h index 2f7d5388cdb..c71df0109f7 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.h +++ b/src/cascadia/TerminalSettingsEditor/MainPage.h @@ -16,6 +16,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Label{ label }, _SubPage{ subPage } {} + hstring ToString() { return _Label; } + WINRT_PROPERTY(IInspectable, Tag); WINRT_PROPERTY(winrt::hstring, Label); WINRT_PROPERTY(BreadcrumbSubPage, SubPage); diff --git a/src/cascadia/TerminalSettingsEditor/MainPage.idl b/src/cascadia/TerminalSettingsEditor/MainPage.idl index 4c771419753..f74b36a0dcd 100644 --- a/src/cascadia/TerminalSettingsEditor/MainPage.idl +++ b/src/cascadia/TerminalSettingsEditor/MainPage.idl @@ -20,7 +20,7 @@ namespace Microsoft.Terminal.Settings.Editor Profile_Advanced }; - runtimeclass Breadcrumb + runtimeclass Breadcrumb : Windows.Foundation.IStringable { IInspectable Tag; String Label;