From 9f3e459e976ba2a94d6bf8e9789405b08376330e Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 15 Feb 2022 06:07:07 -0600 Subject: [PATCH] Manually set the colors of the TabViewBackground (#12460) This has been a saga. Basically, any resources in `App.xaml` aren't going to be able to reference other theme-aware resources. We can't change the theme of the app at runtime, only elements within the app. So we can't use `ApplicationPageBackgroundThemeBrush` in app.xaml, because it will ALWAYS be evaluated as the OS theme version of that brush. * regressed in #12326 * See also #10864 * #3917 CANNOT be fixed in the same way. We're lucky here that the TabView uses a `{ThemeResource TabViewBackground}` in markup to set the bg. We're not similarly lucky with the Pane one. * [x] closes #12356 * [x] Tested manually. You can confirm, my eyes are bleeding from the OS-wide light mode (cherry picked from commit 5ba0d618f54bf7b7588019052bf84071ad914ede) --- src/cascadia/TerminalApp/App.xaml | 22 ++++++++++++++++++---- src/cascadia/TerminalApp/TerminalPage.cpp | 1 - 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/cascadia/TerminalApp/App.xaml b/src/cascadia/TerminalApp/App.xaml index 07273a0151a..07c70c6b72f 100644 --- a/src/cascadia/TerminalApp/App.xaml +++ b/src/cascadia/TerminalApp/App.xaml @@ -54,17 +54,31 @@ - + + + + + - + diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index fb635d9d05c..630378a5d07 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -156,7 +156,6 @@ namespace winrt::TerminalApp::implementation if (_settings.GlobalSettings().UseAcrylicInTabRow()) { const auto res = Application::Current().Resources(); - const auto lightKey = winrt::box_value(L"Light"); const auto darkKey = winrt::box_value(L"Dark"); const auto tabViewBackgroundKey = winrt::box_value(L"TabViewBackground");