From 14ff89d1a8ff5332a0b9ec487856dee398c7196d Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 6 Mar 2023 14:52:46 -0600 Subject: [PATCH 01/25] This at least builds. Let's see what happens next --- src/cascadia/TerminalApp/packages.config | 4 ++++ src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj | 8 ++++++++ src/common.nugetversions.targets | 6 ++++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/cascadia/TerminalApp/packages.config diff --git a/src/cascadia/TerminalApp/packages.config b/src/cascadia/TerminalApp/packages.config new file mode 100644 index 00000000000..26e66ec0693 --- /dev/null +++ b/src/cascadia/TerminalApp/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index 2379a6430a2..01205ccd45b 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -27,6 +27,14 @@ + + + true + + true diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index 91a26fdf59a..d95b699ba6f 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -53,7 +53,8 @@ - + + @@ -86,7 +87,8 @@ - + + From a9ca3da810edc299077f058df58c970b5599d64f Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 7 Mar 2023 09:08:14 -0600 Subject: [PATCH 02/25] for the sake of bookmarking: Add a manual copy of the TabView style this is a copy of the TabView style as of today's main, https://github.com/microsoft/microsoft-ui-xaml/blob/93e23c225c3f3a45878d8300426c6a45dc38c8aa/dev/TabView/TabView.xaml I'm gonna change this to see if we can fix this --- src/cascadia/TerminalApp/TabRowControl.xaml | 10 + src/cascadia/TerminalApp/TabViewStyles.xaml | 1034 +++++++++++++++++ .../TerminalApp/TerminalAppLib.vcxproj | 3 + 3 files changed, 1047 insertions(+) create mode 100644 src/cascadia/TerminalApp/TabViewStyles.xaml diff --git a/src/cascadia/TerminalApp/TabRowControl.xaml b/src/cascadia/TerminalApp/TabRowControl.xaml index d14c2a73d0e..dc1193af7f1 100644 --- a/src/cascadia/TerminalApp/TabRowControl.xaml +++ b/src/cascadia/TerminalApp/TabRowControl.xaml @@ -14,6 +14,15 @@ + + + + + + + + + diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml new file mode 100644 index 00000000000..0925c782bab --- /dev/null +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -0,0 +1,1034 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj index b0815429e30..e60d57bf816 100644 --- a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj +++ b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj @@ -60,6 +60,9 @@ Designer + + Designer + From c80b6f058e57118e1c0d87bd1910e46056975c88 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 06:58:16 -0500 Subject: [PATCH 03/25] what the heck is going on --- dep/nuget/packages.config | 3 ++- src/cascadia/TerminalApp/packages.config | 4 ---- src/common.nugetversions.targets | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/cascadia/TerminalApp/packages.config diff --git a/dep/nuget/packages.config b/dep/nuget/packages.config index 5015d1ee970..09a9c4935d4 100644 --- a/dep/nuget/packages.config +++ b/dep/nuget/packages.config @@ -8,7 +8,8 @@ - + + diff --git a/src/cascadia/TerminalApp/packages.config b/src/cascadia/TerminalApp/packages.config deleted file mode 100644 index 26e66ec0693..00000000000 --- a/src/cascadia/TerminalApp/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index d95b699ba6f..17380238a44 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -54,7 +54,7 @@ - + @@ -88,7 +88,7 @@ - + From feeaa67e8ec0f830c17dc3cc90abb53e433ff494 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 06:58:35 -0500 Subject: [PATCH 04/25] this is what karen said to try, but I can't even load XAML any more --- src/cascadia/TerminalApp/App.xaml | 10 +++++----- src/cascadia/TerminalApp/TabBase.cpp | 11 +++++++---- src/cascadia/TerminalApp/TabRowControl.xaml | 2 +- src/cascadia/TerminalApp/TerminalPage.cpp | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/cascadia/TerminalApp/App.xaml b/src/cascadia/TerminalApp/App.xaml index c2a77c4461d..a9555fdcb97 100644 --- a/src/cascadia/TerminalApp/App.xaml +++ b/src/cascadia/TerminalApp/App.xaml @@ -148,11 +148,11 @@ See GH #12356 for more history on the subject. --> - + ResourceKey="TabViewBackground2" /> @@ -164,11 +164,11 @@ - + ResourceKey="TabViewBackground2" /> @@ -187,7 +187,7 @@ SystemColorButtonFaceColorBrush is the default background color for WinUI's TabViewBackground under high contrast mode. --> - diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index efe73161ec0..61b75d399ca 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -4348,7 +4348,7 @@ namespace winrt::TerminalApp::implementation const auto res = Application::Current().Resources(); // Use our helper to lookup the theme-aware version of the resource. - const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground"); + const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground2"); const auto backgroundSolidBrush = ThemeLookup(res, requestedTheme, tabViewBackgroundKey).as(); til::color bgColor = backgroundSolidBrush.Color(); From b3de7febd57a1dce1fa00a0f8619056cd64eae5f Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 09:10:43 -0500 Subject: [PATCH 05/25] Using a -prerelease at least builds and runs for now --- dep/nuget/packages.config | 2 +- src/common.nugetversions.targets | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dep/nuget/packages.config b/dep/nuget/packages.config index 09a9c4935d4..eb4eba4a6c7 100644 --- a/dep/nuget/packages.config +++ b/dep/nuget/packages.config @@ -8,7 +8,7 @@ - + diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index 17380238a44..e2f0fe79a0d 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -53,7 +53,7 @@ - + @@ -87,7 +87,7 @@ - + From 539e1cc61786ba444f3a18c0c486f6feb7bbe1f0 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 09:10:58 -0500 Subject: [PATCH 06/25] Some failed attempts --- src/cascadia/TerminalApp/TabBase.cpp | 21 ++++++++++++++++++++- src/cascadia/TerminalApp/TabRowControl.xaml | 5 ++--- src/cascadia/TerminalApp/TabViewStyles.xaml | 7 ++++--- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 590d6af6028..488e03d3126 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -476,7 +476,26 @@ namespace winrt::TerminalApp::implementation // TabViewItemHeaderBackground manually, but GH#11382 discovered that // Background() was actually okay after all. - { // attempt 1 + // { // original + // 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); + // } + // { // attempt 1 + // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); + // 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); + // } + // { // attempt 2 + // TabViewItem().Background(selectedTabBrush); + // 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); + // } + { // attempt 3 + // Paired with NOT using custom resources TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); diff --git a/src/cascadia/TerminalApp/TabRowControl.xaml b/src/cascadia/TerminalApp/TabRowControl.xaml index 689c6bf6fea..1ed5beb0b04 100644 --- a/src/cascadia/TerminalApp/TabRowControl.xaml +++ b/src/cascadia/TerminalApp/TabRowControl.xaml @@ -15,13 +15,13 @@ - + diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index 0925c782bab..345222ba1cf 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -679,7 +679,8 @@ - + + @@ -700,7 +701,7 @@ - + @@ -721,7 +722,7 @@ - + From 8cd4b54d81df211e86b626d89251f3d3e9949f49 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 10:37:57 -0500 Subject: [PATCH 07/25] Bunch of things that didn't work --- src/cascadia/TerminalApp/App.xaml | 30 +++++++++++++++ src/cascadia/TerminalApp/TabBase.cpp | 42 +++++++++++++-------- src/cascadia/TerminalApp/TabRowControl.xaml | 5 ++- src/cascadia/TerminalApp/TabViewStyles.xaml | 12 ++++-- 4 files changed, 68 insertions(+), 21 deletions(-) diff --git a/src/cascadia/TerminalApp/App.xaml b/src/cascadia/TerminalApp/App.xaml index a9555fdcb97..adef6eaf58a 100644 --- a/src/cascadia/TerminalApp/App.xaml +++ b/src/cascadia/TerminalApp/App.xaml @@ -156,6 +156,25 @@ + + + + + + + + + + + @@ -172,6 +191,17 @@ + + + + + + diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 488e03d3126..6006b1d2c24 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -476,31 +476,38 @@ namespace winrt::TerminalApp::implementation // TabViewItemHeaderBackground manually, but GH#11382 discovered that // Background() was actually okay after all. - // { // original - // TabViewItem().Background(deselectedTabBrush); + { // original + 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); + } + // { // attempt 1 + // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); // 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); // } - // { // attempt 1 - // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); + // { // attempt 2 + // TabViewItem().Background(selectedTabBrush); // 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); // } - // { // attempt 2 + // { // attempt 3 + // // Paired with NOT using custom resources + // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); + // 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); + // } + // { // attempt 3 + // // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} // TabViewItem().Background(selectedTabBrush); // 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); // } - { // attempt 3 - // Paired with NOT using custom resources - TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); - 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); - } // Similarly, TabViewItem().Foreground() sets the color for the text // when the TabViewItem isn't selected, but not when it is hovered, @@ -588,13 +595,16 @@ namespace winrt::TerminalApp::implementation { if (TabViewItem().IsSelected()) { - VisualStateManager::GoToState(TabViewItem(), L"Normal", true); - VisualStateManager::GoToState(TabViewItem(), L"Selected", true); + VisualStateManager::GoToState(TabViewItem(), L"Normal", false); + // Useless: try switching multiple states on a visual refresh. This did nothing. + VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); + VisualStateManager::GoToState(TabViewItem(), L"Selected", false); } else { - VisualStateManager::GoToState(TabViewItem(), L"Selected", true); - VisualStateManager::GoToState(TabViewItem(), L"Normal", true); + VisualStateManager::GoToState(TabViewItem(), L"Selected", false); + VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); + VisualStateManager::GoToState(TabViewItem(), L"Normal", false); } } diff --git a/src/cascadia/TerminalApp/TabRowControl.xaml b/src/cascadia/TerminalApp/TabRowControl.xaml index 1ed5beb0b04..689c6bf6fea 100644 --- a/src/cascadia/TerminalApp/TabRowControl.xaml +++ b/src/cascadia/TerminalApp/TabRowControl.xaml @@ -15,13 +15,13 @@ - + diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index 345222ba1cf..34d9e074068 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -678,8 +678,10 @@ + - + + @@ -700,8 +702,10 @@ + - + + @@ -722,7 +726,9 @@ - + + + From 82f77667cb38ee9db39ed44981c8c656d2eb24de Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 10:41:26 -0500 Subject: [PATCH 08/25] shorthand --- src/cascadia/TerminalApp/TabBase.cpp | 72 +++++++++++++++------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 6006b1d2c24..30ee39748a3 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -476,37 +476,39 @@ namespace winrt::TerminalApp::implementation // TabViewItemHeaderBackground manually, but GH#11382 discovered that // Background() was actually okay after all. + const auto& tabItemResources{ TabViewItem().Resources() }; + { // original 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); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); } // { // attempt 1 // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); - // 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); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } // { // attempt 2 // TabViewItem().Background(selectedTabBrush); - // 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); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } // { // attempt 3 // // Paired with NOT using custom resources // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); - // 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); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } // { // attempt 3 // // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} // TabViewItem().Background(selectedTabBrush); - // 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); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } // Similarly, TabViewItem().Foreground() sets the color for the text @@ -514,23 +516,23 @@ namespace winrt::TerminalApp::implementation // pressed, dragged, or selected, so we'll need to just set them all // anyways. TabViewItem().Foreground(deselectedFontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), deselectedFontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush); - - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForeground"), deselectedFontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPressed"), secondaryFontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPointerOver"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderPressedCloseButtonForeground"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderPointerOverCloseButtonForeground"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), subtleFillColorTertiaryBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), subtleFillColorSecondaryBrush); - - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundPressed"), fontBrush); - TabViewItem().Resources().Insert(winrt::box_value(L"TabViewButtonForegroundPointerOver"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderForeground"), deselectedFontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderForegroundPressed"), fontBrush); + + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForeground"), deselectedFontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPressed"), secondaryFontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonForegroundPointerOver"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderPressedCloseButtonForeground"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderPointerOverCloseButtonForeground"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), subtleFillColorTertiaryBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), subtleFillColorSecondaryBrush); + + tabItemResources.Insert(winrt::box_value(L"TabViewButtonForegroundActiveTab"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewButtonForegroundPressed"), fontBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewButtonForegroundPointerOver"), fontBrush); _RefreshVisualState(); } @@ -566,13 +568,15 @@ namespace winrt::TerminalApp::implementation L"TabViewButtonForegroundPointerOver" }; + const auto& tabItemResources{ TabViewItem().Resources() }; + // simply clear any of the colors in the tab's dict for (const auto& keyString : keys) { auto key = winrt::box_value(keyString); - if (TabViewItem().Resources().HasKey(key)) + if (tabItemResources.HasKey(key)) { - TabViewItem().Resources().Remove(key); + tabItemResources.Remove(key); } } From ed5ed769b99c9ae8445aff4bce441e96755148a5 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 13:13:43 -0500 Subject: [PATCH 09/25] OH SHIT ONE OF THESE CRAZY IDEAS WORKED but I have no idea which, and hovering doesn't work, but it's BETTER --- src/cascadia/TerminalApp/TabBase.cpp | 44 +++++++++++++++------ src/cascadia/TerminalApp/TabViewStyles.xaml | 17 +++++--- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 30ee39748a3..6efd5631f15 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -478,12 +478,12 @@ namespace winrt::TerminalApp::implementation const auto& tabItemResources{ TabViewItem().Resources() }; - { // original - TabViewItem().Background(deselectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - } + // { // original + // TabViewItem().Background(deselectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); + // } // { // attempt 1 // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); @@ -511,6 +511,17 @@ namespace winrt::TerminalApp::implementation // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } + { // attempt 4 + // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} + TabViewItem().Background(deselectedTabBrush); + + TabViewItem().Content().try_as().Background(selectedTabBrush); + + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); + } + // Similarly, TabViewItem().Foreground() sets the color for the text // when the TabViewItem isn't selected, but not when it is hovered, // pressed, dragged, or selected, so we'll need to just set them all @@ -599,17 +610,24 @@ namespace winrt::TerminalApp::implementation { if (TabViewItem().IsSelected()) { - VisualStateManager::GoToState(TabViewItem(), L"Normal", false); + VisualStateManager::GoToState(TabViewItem(), L"Normal", true); // Useless: try switching multiple states on a visual refresh. This did nothing. - VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); - VisualStateManager::GoToState(TabViewItem(), L"Selected", false); + // VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); + VisualStateManager::GoToState(TabViewItem(), L"Selected", true); } else { - VisualStateManager::GoToState(TabViewItem(), L"Selected", false); - VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); - VisualStateManager::GoToState(TabViewItem(), L"Normal", false); + VisualStateManager::GoToState(TabViewItem(), L"Selected", true); + // VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); + VisualStateManager::GoToState(TabViewItem(), L"Normal", true); } - } + auto reqTheme = TabViewItem().RequestedTheme(); + // TabViewItem().RequestedTheme(reqTheme == ElementTheme::Dark ? ElementTheme::Light : ElementTheme::Dark); + TabViewItem().RequestedTheme(ElementTheme::Light); + TabViewItem().RequestedTheme(ElementTheme::Dark); + TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [&]() { + TabViewItem().RequestedTheme(reqTheme); + }); + } } diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index 34d9e074068..4c5fd61d988 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -653,7 +653,8 @@ - + + @@ -664,7 +665,8 @@ - + + @@ -683,11 +685,14 @@ - + + + + @@ -706,11 +711,12 @@ - + + @@ -729,11 +735,12 @@ - + + From 0a8a079026b846ae37298c820f1db33da9a9f591 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 13:27:34 -0500 Subject: [PATCH 10/25] Narrow it down - this works too --- src/cascadia/TerminalApp/TabBase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 6efd5631f15..f4a26047a2e 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -626,8 +626,9 @@ namespace winrt::TerminalApp::implementation // TabViewItem().RequestedTheme(reqTheme == ElementTheme::Dark ? ElementTheme::Light : ElementTheme::Dark); TabViewItem().RequestedTheme(ElementTheme::Light); TabViewItem().RequestedTheme(ElementTheme::Dark); - TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [&]() { - TabViewItem().RequestedTheme(reqTheme); - }); + // TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [&]() { + // TabViewItem().RequestedTheme(reqTheme); + // }); + TabViewItem().RequestedTheme(reqTheme); } } From fd467eb74d9c84eef0e0880fa5b74ecff71563c9 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 13:42:00 -0500 Subject: [PATCH 11/25] narrow it down more --- src/cascadia/TerminalApp/TabBase.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index f4a26047a2e..5af138dc91b 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -478,12 +478,12 @@ namespace winrt::TerminalApp::implementation const auto& tabItemResources{ TabViewItem().Resources() }; - // { // original - // TabViewItem().Background(deselectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } + { // original + TabViewItem().Background(deselectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); + } // { // attempt 1 // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); @@ -511,16 +511,16 @@ namespace winrt::TerminalApp::implementation // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // } - { // attempt 4 - // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} - TabViewItem().Background(deselectedTabBrush); + // { // attempt 4 + // // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} + // TabViewItem().Background(deselectedTabBrush); - TabViewItem().Content().try_as().Background(selectedTabBrush); + // TabViewItem().Content().try_as().Background(selectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - } + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); + // } // Similarly, TabViewItem().Foreground() sets the color for the text // when the TabViewItem isn't selected, but not when it is hovered, From cf96f887728ca37b9c47667076174e31fe71c2eb Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 13:45:48 -0500 Subject: [PATCH 12/25] Bring the hover color back --- src/cascadia/TerminalApp/TabViewStyles.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index 4c5fd61d988..83537c5af97 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -653,7 +653,7 @@ - + From e0ee0b88be0a7824ac6816ad8d4fecd49abfe04e Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 13:55:16 -0500 Subject: [PATCH 13/25] Didn't need these --- src/cascadia/TerminalApp/App.xaml | 28 ----------------- src/cascadia/TerminalApp/TabBase.cpp | 47 +++------------------------- 2 files changed, 4 insertions(+), 71 deletions(-) diff --git a/src/cascadia/TerminalApp/App.xaml b/src/cascadia/TerminalApp/App.xaml index adef6eaf58a..109df1d4919 100644 --- a/src/cascadia/TerminalApp/App.xaml +++ b/src/cascadia/TerminalApp/App.xaml @@ -157,24 +157,6 @@ - - - - - - - - - - @@ -192,16 +174,6 @@ - - - - - diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 5af138dc91b..7af39e2d6e6 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -478,49 +478,10 @@ namespace winrt::TerminalApp::implementation const auto& tabItemResources{ TabViewItem().Resources() }; - { // original - TabViewItem().Background(deselectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - } - // { // attempt 1 - // // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } - // { // attempt 2 - // TabViewItem().Background(selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } - // { // attempt 3 - // // Paired with NOT using custom resources - // TabViewItem().Background(WUX::Media::SolidColorBrush{ Windows::UI::Colors::Transparent() }); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } - // { // attempt 3 - // // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} - // TabViewItem().Background(selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } - - // { // attempt 4 - // // Paired with setting the SelectedBackgroundPath.Fill to {TemplateBinding Background} - // TabViewItem().Background(deselectedTabBrush); - - // TabViewItem().Content().try_as().Background(selectedTabBrush); - - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); - // tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); - // } + TabViewItem().Background(deselectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush); + tabItemResources.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush); // Similarly, TabViewItem().Foreground() sets the color for the text // when the TabViewItem isn't selected, but not when it is hovered, From 900b64f1f0d57bf3a9309b71ffa43fb1dc3eeb4a Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:07:24 -0500 Subject: [PATCH 14/25] If this one's okay, are they all okay? --- src/cascadia/TerminalApp/TabViewStyles.xaml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index 83537c5af97..e05c7656bc1 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -654,7 +654,6 @@ - @@ -666,7 +665,6 @@ - @@ -680,19 +678,13 @@ - - - - - - + - @@ -707,16 +699,13 @@ - - - @@ -732,15 +721,12 @@ - - - From dbd7c4b717cd35429e3e82d759afaa9bc451f1b3 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:10:59 -0500 Subject: [PATCH 15/25] Honestly, do I even need custom styles at all? --- src/cascadia/TerminalApp/TabBase.cpp | 6 ------ src/cascadia/TerminalApp/TabViewStyles.xaml | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 7af39e2d6e6..06b2190e183 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -572,14 +572,11 @@ namespace winrt::TerminalApp::implementation if (TabViewItem().IsSelected()) { VisualStateManager::GoToState(TabViewItem(), L"Normal", true); - // Useless: try switching multiple states on a visual refresh. This did nothing. - // VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); VisualStateManager::GoToState(TabViewItem(), L"Selected", true); } else { VisualStateManager::GoToState(TabViewItem(), L"Selected", true); - // VisualStateManager::GoToState(TabViewItem(), L"PointerOver", false); VisualStateManager::GoToState(TabViewItem(), L"Normal", true); } @@ -587,9 +584,6 @@ namespace winrt::TerminalApp::implementation // TabViewItem().RequestedTheme(reqTheme == ElementTheme::Dark ? ElementTheme::Light : ElementTheme::Dark); TabViewItem().RequestedTheme(ElementTheme::Light); TabViewItem().RequestedTheme(ElementTheme::Dark); - // TabViewItem().Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [&]() { - // TabViewItem().RequestedTheme(reqTheme); - // }); TabViewItem().RequestedTheme(reqTheme); } } diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml index e05c7656bc1..0925c782bab 100644 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ b/src/cascadia/TerminalApp/TabViewStyles.xaml @@ -664,7 +664,7 @@ - + @@ -701,7 +701,7 @@ - + @@ -722,7 +722,7 @@ - + From 00603bf7cf973eb3b081d9c4c4e30be67293830b Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:18:08 -0500 Subject: [PATCH 16/25] SERIOUSLY WE DIDN'T NEED ANY OF THIS --- src/cascadia/TerminalApp/App.xaml | 12 +++++------- src/cascadia/TerminalApp/TabRowControl.xaml | 2 +- src/cascadia/TerminalApp/TerminalPage.cpp | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/cascadia/TerminalApp/App.xaml b/src/cascadia/TerminalApp/App.xaml index 109df1d4919..c2a77c4461d 100644 --- a/src/cascadia/TerminalApp/App.xaml +++ b/src/cascadia/TerminalApp/App.xaml @@ -148,15 +148,14 @@ See GH #12356 for more history on the subject. --> - + ResourceKey="TabViewBackground" /> - @@ -165,15 +164,14 @@ - + ResourceKey="TabViewBackground" /> - @@ -189,7 +187,7 @@ SystemColorButtonFaceColorBrush is the default background color for WinUI's TabViewBackground under high contrast mode. --> - diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 61b75d399ca..efe73161ec0 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -4348,7 +4348,7 @@ namespace winrt::TerminalApp::implementation const auto res = Application::Current().Resources(); // Use our helper to lookup the theme-aware version of the resource. - const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground2"); + const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground"); const auto backgroundSolidBrush = ThemeLookup(res, requestedTheme, tabViewBackgroundKey).as(); til::color bgColor = backgroundSolidBrush.Color(); From e8bb5b72761687d85449e708d2b2e2ea62a1067b Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:20:47 -0500 Subject: [PATCH 17/25] i am dead inside --- src/cascadia/TerminalApp/TabBase.cpp | 3 +-- src/cascadia/TerminalApp/TabRowControl.xaml | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 06b2190e183..c7900fabf96 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -580,8 +580,7 @@ namespace winrt::TerminalApp::implementation VisualStateManager::GoToState(TabViewItem(), L"Normal", true); } - auto reqTheme = TabViewItem().RequestedTheme(); - // TabViewItem().RequestedTheme(reqTheme == ElementTheme::Dark ? ElementTheme::Light : ElementTheme::Dark); + const auto& reqTheme = TabViewItem().RequestedTheme(); TabViewItem().RequestedTheme(ElementTheme::Light); TabViewItem().RequestedTheme(ElementTheme::Dark); TabViewItem().RequestedTheme(reqTheme); diff --git a/src/cascadia/TerminalApp/TabRowControl.xaml b/src/cascadia/TerminalApp/TabRowControl.xaml index dc1193af7f1..d14c2a73d0e 100644 --- a/src/cascadia/TerminalApp/TabRowControl.xaml +++ b/src/cascadia/TerminalApp/TabRowControl.xaml @@ -14,15 +14,6 @@ - - - - - - - - - From b95764020fb68e3b7b227db4b3b7bd2e95ed84c4 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:25:02 -0500 Subject: [PATCH 18/25] 100%, this doesn't make sense, but I'll take what I can get --- src/cascadia/TerminalApp/TabBase.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index c7900fabf96..fd011d75e61 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -561,25 +561,16 @@ namespace winrt::TerminalApp::implementation } // Method Description: - // Toggles the visual state of the tab view item, - // so that changes to the tab color are reflected immediately + // - Toggles the requested theme of the tab view item, + // so that changes to the tab color are reflected immediately + // - Prior to MUX 2.8, we toggled the visual state here, but that seemingly + // doesn't work in 2.8. // Arguments: // - // Return Value: // - void TabBase::_RefreshVisualState() { - if (TabViewItem().IsSelected()) - { - VisualStateManager::GoToState(TabViewItem(), L"Normal", true); - VisualStateManager::GoToState(TabViewItem(), L"Selected", true); - } - else - { - VisualStateManager::GoToState(TabViewItem(), L"Selected", true); - VisualStateManager::GoToState(TabViewItem(), L"Normal", true); - } - const auto& reqTheme = TabViewItem().RequestedTheme(); TabViewItem().RequestedTheme(ElementTheme::Light); TabViewItem().RequestedTheme(ElementTheme::Dark); From f6c97282c42b0e73bbb428d3daafd15a079a8101 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:27:10 -0500 Subject: [PATCH 19/25] I guess I didn't need that. Moving on. --- src/cascadia/TerminalApp/TabViewStyles.xaml | 1034 ----------------- .../TerminalApp/TerminalAppLib.vcxproj | 3 - 2 files changed, 1037 deletions(-) delete mode 100644 src/cascadia/TerminalApp/TabViewStyles.xaml diff --git a/src/cascadia/TerminalApp/TabViewStyles.xaml b/src/cascadia/TerminalApp/TabViewStyles.xaml deleted file mode 100644 index 0925c782bab..00000000000 --- a/src/cascadia/TerminalApp/TabViewStyles.xaml +++ /dev/null @@ -1,1034 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj index e60d57bf816..b0815429e30 100644 --- a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj +++ b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj @@ -60,9 +60,6 @@ Designer - - Designer - From 9801a9698f5a65408676c506997d1214387194ec Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 14:42:14 -0500 Subject: [PATCH 20/25] Off the -prerelease, to the main one. Let's see if CI likes it --- dep/nuget/packages.config | 2 +- src/common.nugetversions.targets | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dep/nuget/packages.config b/dep/nuget/packages.config index eb4eba4a6c7..09a9c4935d4 100644 --- a/dep/nuget/packages.config +++ b/dep/nuget/packages.config @@ -8,7 +8,7 @@ - + diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index e2f0fe79a0d..17380238a44 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -53,7 +53,7 @@ - + @@ -87,7 +87,7 @@ - + From e907caed86ab3c8057620e98df76b86622336b57 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 31 Mar 2023 15:26:52 -0500 Subject: [PATCH 21/25] hopefully ci likes this? --- src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj | 6 ++++++ src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj b/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj index 76858394072..434dce45cc8 100644 --- a/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj +++ b/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj @@ -13,6 +13,12 @@ true true + + + true diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index 01205ccd45b..f4fed4d06ca 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -28,7 +28,7 @@ - From ca614e2efc1f941896dac97e6776d7b6ae4b9bae Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 3 Apr 2023 12:48:18 -0500 Subject: [PATCH 22/25] LMAO we never included the MUX .props. See also https://github.com/microsoft/microsoft-ui-xaml/pull/7574 --- src/common.nugetversions.props | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common.nugetversions.props b/src/common.nugetversions.props index 19147f5e977..a3ac0f8ec9b 100644 --- a/src/common.nugetversions.props +++ b/src/common.nugetversions.props @@ -36,4 +36,7 @@ $(MSBuildThisFileDirectory)..\packages\Selenium.Support.3.5.0 + + + From 21f991016d98e74108c41000963d4b7d99d7d5a8 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 3 Apr 2023 15:56:31 -0500 Subject: [PATCH 23/25] Update src/cascadia/TerminalApp/TabBase.cpp --- src/cascadia/TerminalApp/TabBase.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index fd011d75e61..6761ab3dac1 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -561,6 +561,7 @@ namespace winrt::TerminalApp::implementation } // Method Description: + // BODGY // - Toggles the requested theme of the tab view item, // so that changes to the tab color are reflected immediately // - Prior to MUX 2.8, we toggled the visual state here, but that seemingly From 38502d7f888a96f20e11a46b20f64f1efaafdb70 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 3 Apr 2023 17:08:07 -0500 Subject: [PATCH 24/25] Try really hard to not depend on WebView2 (#15096) --- build/rules/Microsoft.UI.Xaml.Additional.targets | 16 ++++++++++++++++ src/common.nugetversions.targets | 9 ++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 build/rules/Microsoft.UI.Xaml.Additional.targets diff --git a/build/rules/Microsoft.UI.Xaml.Additional.targets b/build/rules/Microsoft.UI.Xaml.Additional.targets new file mode 100644 index 00000000000..dbd6eb3f35c --- /dev/null +++ b/build/rules/Microsoft.UI.Xaml.Additional.targets @@ -0,0 +1,16 @@ + + + + + + + diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index 17380238a44..e047b9931d2 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -16,6 +16,8 @@ "$(SolutionDir)dep\nuget\nuget.exe" $(SolutionDir)dep\nuget\packages.config + + $(MSBuildThisFileDirectory)..\packages\Microsoft.Web.WebView2.1.0.1661.34 - + + From 5ed2296a7684ec70b7d1326ba6d95d8f979f1f1b Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 3 Apr 2023 17:09:28 -0500 Subject: [PATCH 25/25] Remove WebView2UseWinRT from everywhere --- src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj | 6 ------ src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj | 8 -------- 2 files changed, 14 deletions(-) diff --git a/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj b/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj index 434dce45cc8..76858394072 100644 --- a/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj +++ b/src/cascadia/UnitTests_Control/Control.UnitTests.vcxproj @@ -13,12 +13,6 @@ true true - - - true diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index f4fed4d06ca..2379a6430a2 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -27,14 +27,6 @@ - - - true - - true