Skip to content
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

Merged
1 commit merged into from
Sep 29, 2021
Merged

Conversation

zadjii-msft
Copy link
Member

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.

  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
@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree. labels Sep 29, 2021
Comment on lines +1463 to +1472
//
// 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);
Copy link
Member

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?

Copy link
Member Author

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 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Sep 29, 2021
@ghost
Copy link

ghost commented Sep 29, 2021

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit ba23902 into main Sep 29, 2021
@ghost ghost deleted the dev/migrie/b/11294-OOF.jpg branch September 29, 2021 21:58
@Rosefield Rosefield mentioned this pull request Sep 30, 2021
@zadjii-msft zadjii-msft mentioned this pull request Oct 4, 2021
2 tasks
ghost pushed a commit that referenced this pull request Oct 5, 2021
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
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MUX 2.7: TerminalTab tabs don't respond to clicks on background
3 participants