the other part

This commit is contained in:
Mike Griese
2022-11-28 11:05:31 -06:00
parent fdb6752dac
commit 14e270d57e

View File

@@ -2658,9 +2658,14 @@ namespace winrt::TerminalApp::implementation
Media::Imaging::BitmapImage image(imageUri);
b.ImageSource(image);
_tabContent.Background(b);
}
b.Stretch(newAppearance.BackgroundImageStretchMode());
b.Opacity(newAppearance.BackgroundImageOpacity());
// Pull this into a separate block. If the image didn't change, but the
// properties of the image did, we should still update them.
if (const auto newBrush{ _tabContent.Background().try_as<Media::ImageBrush>() })
{
newBrush.Stretch(newAppearance.BackgroundImageStretchMode());
newBrush.Opacity(newAppearance.BackgroundImageOpacity());
}
}
@@ -2694,14 +2699,6 @@ namespace winrt::TerminalApp::implementation
profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, nullptr });
}
if (const auto focusedTab{ _GetFocusedTabImpl() })
{
if (const auto profile{ focusedTab->GetFocusedProfile() })
{
_SetBackgroundImage(profile.DefaultAppearance());
}
}
for (const auto& tab : _tabs)
{
if (auto terminalTab{ _GetTerminalTabImpl(tab) })
@@ -2747,6 +2744,14 @@ namespace winrt::TerminalApp::implementation
tabImpl->SetActionMap(_settings.ActionMap());
}
if (const auto focusedTab{ _GetFocusedTabImpl() })
{
if (const auto profile{ focusedTab->GetFocusedProfile() })
{
_SetBackgroundImage(profile.DefaultAppearance());
}
}
// repopulate the new tab button's flyout with entries for each
// profile, which might have changed
_UpdateTabWidthMode();