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

A pile of Theming nits fixes #13465

Merged
8 commits merged into from
Jul 12, 2022
Merged

A pile of Theming nits fixes #13465

8 commits merged into from
Jul 12, 2022

Conversation

zadjii-msft
Copy link
Member

The main fix here is for the caption button colors. If you had a dark OS/app theme, and a light titlebar, we'd end up with light glyphs, so the caption buttons would be impossible to find.

There's also a pile of nits from #12992 in here. Probably enough to close #13456 out, but I'll let Dustin be the judge.

Filing today, to get in for 1.16 selfhost (@DHowett)

@ghost ghost added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Area-Theming Anything related to the theming of elements of the window Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Jul 8, 2022
Comment on lines +151 to +159
til::color c;
if (auto acrylic = brush.try_as<winrt::Windows::UI::Xaml::Media::AcrylicBrush>())
{
c = acrylic.TintColor();
}
else if (auto solidColor = brush.try_as<winrt::Windows::UI::Xaml::Media::SolidColorBrush>())
{
c = solidColor.Color();
}
Copy link
Member

Choose a reason for hiding this comment

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

what will c be initialized to if it's neither Acrylic nor SolidColor?

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

(I only have the same question as Dustin regarding til::color.)

Comment on lines +35 to +37
const auto bgProperty{ winrt::Windows::UI::Xaml::Controls::Panel::BackgroundProperty() };
RegisterPropertyChangedCallback(bgProperty, [weakThis = get_weak(), bgProperty](auto& /*sender*/, auto& e) {
if (auto self{ weakThis.get() })
Copy link
Member

Choose a reason for hiding this comment

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

In this very narrow case, you can capture this directly. You will not be getting property change callbacks after you get destructed, afterall :)

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

ghost commented Jul 12, 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 3f21996 into main Jul 12, 2022
@ghost ghost deleted the dev/migrie/b/13456-themes-nits-000 branch July 12, 2022 12:30
@@ -4101,27 +4100,25 @@ namespace winrt::TerminalApp::implementation

TitlebarBrush(acrylicBrush);
}
else if (theme.TabRow())
else if (const auto tabRowBg{ _activated ? theme.TabRow().Background() :
Copy link
Contributor

Choose a reason for hiding this comment

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

This call is causing a crash on startup in the current build of main with the error Access violation reading location 0x0000000000000000 (just did a git pull, clean and tried to run)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I think the theme.TabRow() != nullptr check should come before we try to access the Background?

@ghost
Copy link

ghost commented Sep 13, 2022

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

Handy links:

@ghost ghost mentioned this pull request Sep 13, 2022
20 tasks
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-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Area-Theming Anything related to the theming of elements of the window 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nits from themes PR
4 participants