Skip to content

Manually set the colors of the TabViewBackground#12460

Merged
3 commits merged intomainfrom
dev/migrie/b/12356-attempt-3
Feb 15, 2022
Merged

Manually set the colors of the TabViewBackground#12460
3 commits merged intomainfrom
dev/migrie/b/12356-attempt-3

Conversation

@zadjii-msft
Copy link
Member

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.

@ghost ghost added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Feb 10, 2022
@miniksa
Copy link
Member

miniksa commented Feb 10, 2022

You can confirm, my eyes are bleeding from the OS-wide light mode

Ha.

if (_settings.GlobalSettings().UseAcrylicInTabRow())
{
const auto res = Application::Current().Resources();

Copy link
Member

Choose a reason for hiding this comment

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

Sure I mean... sure...

@zadjii-msft
Copy link
Member Author

For clarity of intent, I'm gonna merge this one now and update the values in a separate PR.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 15, 2022
@ghost
Copy link

ghost commented Feb 15, 2022

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.

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 5ba0d61 into main Feb 15, 2022
@ghost ghost deleted the dev/migrie/b/12356-attempt-3 branch February 15, 2022 12:07
DHowett pushed a commit that referenced this pull request Feb 16, 2022
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 5ba0d61)
@zadjii-msft zadjii-msft mentioned this pull request Feb 18, 2022
zadjii-msft added a commit that referenced this pull request Mar 3, 2022
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
@ghost
Copy link

ghost commented Mar 25, 2022

🎉Windows Terminal Preview v1.13.1073 has been released which incorporates this pull request.:tada:

Handy links:

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-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) 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. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Acrylic Broken

4 participants