-
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
Allow starting selections from padding area #6343
Conversation
Marking as ready for review. The issue above just exposes #5099 more. I'm working on that for this milestone anyways. |
fceab19
to
0b2564d
Compare
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 don't understand exactly what's going on here. Can you explain who owns the padding and the margin now? You've removed the SwapChainPanel's margin from calculations, but you're .. still setting it? And the grid that is receiving input doesn't have a margin OR padding?
Can you still click in Search, even when MC is running?
When a user interacts with that newly added space, you are not hitting SCP. So, you instead hit the parent (Grid). So I moved the pointer handlers up to the parent. Now, if you click on...
The last bit is that to actually pass a hit test, you need to be "visible". So, I made Grid Visible and Transparent.
Works as expected :) mouse input is handled on the Search Box and does not leak through to the underlying MC. But if I click on MC while the Search Box is open, focus moves to MC and you actually interact with MC (same as before). |
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
WinUI's
Margin
andPadding
work very similarly.Margin
distancesourselves from our parent. Whereas
Padding
distances our children fromourselves.
Terminal's
padding
setting is actually implemented by definingMargin
on the SwapChainPanel. This means that the "padding" that iscreated 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
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