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

Update MUX to 2.8 #13657

Closed
wants to merge 1 commit into from
Closed

Update MUX to 2.8 #13657

wants to merge 1 commit into from

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Aug 2, 2022

Just a draft to make sure it builds in CI

@ghost ghost added Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Aug 2, 2022
@zadjii-msft
Copy link
Member Author

Ho boy we're in rough shape here. WinUI 2.8 made some changes to how TabViewItems are colorized, and now we can't recolor our tabs.

refer to:

I think I see what's going on here. The Setter in the visual state - the one that sets the TabContainer.Background. That evaluates the Value when the TabViewItem gets instantiated (so {ThemeResource TabViewItemHeaderBackground} is already evaluated as Transparent), doesn't it. So, when we change the resources later, at runtime, it's already too late. The setter will always reset the background to Transparent, not the current value of TabViewItemHeaderBackground

I'm not sure there's a good way for us to get around this. Certainly not without creative use of a retemplate of the TabView styles.

@zadjii-msft
Copy link
Member Author

Gonna close this out for now. We're too far away from landing this and the crash fix is gonna get hotfixed in a 2.7 update.

@zadjii-msft
Copy link
Member Author

zadjii-msft commented Mar 6, 2023

image

https://github.com/microsoft/terminal/pull/new/dev/migrie/mux-2.8.2-march-2023

Notes:

  • Copied the tab view resources into our sln to entirely re-template it.

  • Commented out all the TabContainer.Background. This brought back the color on tabs, but not always, and faintly:
    image
    Seems as though there's some visual style that's manually applying a 0.301961 Opacity to the background. But who?
    image

  • Resizing the window with a colored tab creates a VERY visible visual artifact (working on gif) TODO!

  • Oh right there's this wacky code:

          // In GH#11294 we thought we'd still need to set
          // TabViewItemHeaderBackground manually, but GH#11382 discovered that
          // Background() was actually okay after all.
          TabViewItem().Background(deselectedTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
          TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
  • but who

    But doctor, I am pagliacci

          // Start with the current tab color, set to Opacity=.3
          til::color deselectedTabColor{ color };
          deselectedTabColor = deselectedTabColor.with_alpha(77); // 255 * .3 = 77

    image

diff:

changes to the winui repo that might be relevant:

git log afa4a59f0d8d22bc2553492a49f6e017797869e1..0c556e89bf4d539c2fb3e5fe0a71e57a79fb3a1b --pretty=format:"%h %ad %s" --date=short -- dev/TabView/TabView.xaml
93e23c22 2022-07-29 Set IsTabStop=False on scroll buttons in TabView (#7539)
8e41f536 2022-06-10 [ TabView ] High contrast scroll buttons fix (#7205)
85167636 2022-05-18 set TabContainer to Transparent on selected (#7110)
6fb99c9e 2022-03-04 [TabView] Update high contrast colors | MicaAlt colors - update high contrast colors (#6787)
ef88a2ff 2022-02-07 fixed bottom right inverted contour (#6679)
2e162a90 2022-01-27 TabView Colours Update (#6573)
4a3921b8 2022-01-20 TabView Miscellaneous Fixes (#6598)
019d045b 2021-11-19 TabView: Separate border lines into being everywhere except the selected tab (#6332)
92fbfcd5 2021-11-18 TabViewItem: Make background of the selected tab all one path (#6282)
f4d71ea4 2021-10-01 Fixes TabView bottom border line is too short #5954 (#5981)

@zadjii-msft
Copy link
Member Author

Upstream: microsoft/microsoft-ui-xaml#8260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to WinUI 2.8 (was: History size overlaps with widget controls)
1 participant