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.
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.
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 😉
|
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:  ## 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
TabViewItemHeaderBackgroundmanually.