Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow starting selections from padding area (#6343)
WinUI's `Margin` and `Padding` work very similarly. `Margin` distances ourselves from our parent. Whereas `Padding` distances our children from ourselves. Terminal's `padding` setting is actually implemented by defining `Margin` on the SwapChainPanel. This means that the "padding" that is created is actually belongs to SwapChainPanel's parent: Grid (not to be confused with its parent, "RootGrid"). When a user clicks on the padded area, input goes to Grid. But there's a twist: you can't actually hit Grid. To be able to hit Grid, you can't just set IsHitTestVisible. You need to set it's Visibility to Visible, and it's Background to Transparent (not null) [2]. ## Validation Steps Performed - [X] Start a selection from the padding area - [X] Click on a SearchBox if one is available - The SearchBox gets first dibs on the hit test so none gets through to the SwapChainPanel ## References [1] https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.ishittestvisible [2] https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/events-and-routed-events-overview#hit-testing-and-input-events Closes #5626
- Loading branch information