-
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 the entire Tab to be hit testable again #11369
Conversation
DESPITE the fact that there's a `Background()` API that we could just call like: ```c++ TabViewItem().Background(deselectedTabBrush); ``` We actually can't, because it will make the part of the tab that doesn't contain the text totally transparent to hit tests. So we actually _do_ still need to set `TabViewItemHeaderBackground` manually. * Regressed in #11240 * Root cause up in microsoft/microsoft-ui-xaml#3769 * [x] closes #11294
// | ||
// GH#11294: DESPITE the fact that there's a Background() API that we | ||
// could just call like: | ||
// | ||
// TabViewItem().Background(deselectedTabBrush); | ||
// | ||
// We actually can't, because it will make the part of the tab that | ||
// doesn't contain the text totally transparent to hit tests. So we | ||
// actually _do_ still need to set TabViewItemHeaderBackground manually. | ||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush); |
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.
Are they planning to correct this on the MUX side too? I guess even if they do, this method will work, right?
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've got a personal todo to follow up about all this, since clearly the background API does basically nothing that we want. This will be a part of that conversation 😉
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.
Sounds good.
Hello @zadjii-msft! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 76 seconds. No worries though, I will be back when the time is right! 😉 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 (
|
I've had a hard time with the tab colors this week. Turns out that setting the background to nullptr will make the tabviewitem invisible to hit tests. `Transparent`, on the other hand, is totally valid, and the expected default. Tabs as of this commit: ![tab-color-fix-3](https://user-images.githubusercontent.com/18356694/135915272-ff90b28b-f260-493e-bf0b-3450b4702dce.gif) ## PR Checklist * [x] Closes #11382 * [x] I work here This low-key reverts a bit of #11369, which fixed #11294, which regressed in #11240
DESPITE the fact that there's a
Background()
API that wecould just call like:
TabViewItem().Background(deselectedTabBrush);
We actually can't, because it will make the part of the tab that
doesn't contain the text totally transparent to hit tests. So we
actually do still need to set
TabViewItemHeaderBackground
manually.