Initialize the padding for the Control UIA provider (#10874)
## Summary of the Pull Request This was missed in #10051. We need to make sure that the UIA provider can immediately know about the padding in the control, not just after the settings reload. ## PR Checklist * [x] Closes #9955.e * [x] Additionally, this just closes #9955. The only remaining box in there never repro'd, so probably wasn't even root caused by #9820. I think we can close that issue for now, and reactivate if something else was broken. * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed Checked before/after in Accessibility Insights. Before the row rectangles were the full width of the control initially. Now they're properly padded.
This commit is contained in:
parent
ebf41dd6b2
commit
121fb739fd
|
@ -517,7 +517,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
||||||
if (const auto& interactivityAutoPeer{ _interactivity.OnCreateAutomationPeer() })
|
if (const auto& interactivityAutoPeer{ _interactivity.OnCreateAutomationPeer() })
|
||||||
{
|
{
|
||||||
_automationPeer = winrt::make<implementation::TermControlAutomationPeer>(this, interactivityAutoPeer);
|
auto margins{ SwapChainPanel().Margin() };
|
||||||
|
|
||||||
|
Core::Padding padding{ margins.Left,
|
||||||
|
margins.Top,
|
||||||
|
margins.Right,
|
||||||
|
margins.Bottom };
|
||||||
|
_automationPeer = winrt::make<implementation::TermControlAutomationPeer>(this, padding, interactivityAutoPeer);
|
||||||
return _automationPeer;
|
return _automationPeer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,13 +31,14 @@ namespace XamlAutomation
|
||||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
{
|
{
|
||||||
TermControlAutomationPeer::TermControlAutomationPeer(TermControl* owner,
|
TermControlAutomationPeer::TermControlAutomationPeer(TermControl* owner,
|
||||||
|
const Core::Padding padding,
|
||||||
Control::InteractivityAutomationPeer impl) :
|
Control::InteractivityAutomationPeer impl) :
|
||||||
TermControlAutomationPeerT<TermControlAutomationPeer>(*owner), // pass owner to FrameworkElementAutomationPeer
|
TermControlAutomationPeerT<TermControlAutomationPeer>(*owner), // pass owner to FrameworkElementAutomationPeer
|
||||||
_termControl{ owner },
|
_termControl{ owner },
|
||||||
_contentAutomationPeer{ impl }
|
_contentAutomationPeer{ impl }
|
||||||
{
|
{
|
||||||
UpdateControlBounds();
|
UpdateControlBounds();
|
||||||
|
SetControlPadding(padding);
|
||||||
// Listen for UIA signalling events from the implementation. We need to
|
// Listen for UIA signalling events from the implementation. We need to
|
||||||
// be the one to actually raise these automation events, so they go
|
// be the one to actually raise these automation events, so they go
|
||||||
// through the UI tree correctly.
|
// through the UI tree correctly.
|
||||||
|
|
|
@ -43,6 +43,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TermControlAutomationPeer(Microsoft::Terminal::Control::implementation::TermControl* owner,
|
TermControlAutomationPeer(Microsoft::Terminal::Control::implementation::TermControl* owner,
|
||||||
|
const Core::Padding padding,
|
||||||
Control::InteractivityAutomationPeer implementation);
|
Control::InteractivityAutomationPeer implementation);
|
||||||
|
|
||||||
void UpdateControlBounds();
|
void UpdateControlBounds();
|
||||||
|
|
Loading…
Reference in a new issue