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

Use ThemeLookup for the SUI bg too #14644

Merged
1 commit merged into from
Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/cascadia/TerminalSettingsEditor/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "InteractionViewModel.h"
#include "LaunchViewModel.h"
#include "..\types\inc\utils.hpp"
#include <..\WinRTUtils\inc\Utils.h>

#include <LibraryResources.h>

Expand Down Expand Up @@ -648,12 +649,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

{
const auto& theme = _settingsSource.GlobalSettings().CurrentTheme();
const auto& requestedTheme = _settingsSource.GlobalSettings().CurrentTheme().RequestedTheme();

RequestedTheme(requestedTheme);

const auto bgKey = (theme.Window() != nullptr && theme.Window().UseMica()) ?
L"SettingsPageMicaBackground" :
L"SettingsPageBackground";

if (const auto bgColor = Resources().TryLookup(winrt::box_value(bgKey)))
// remember to use ThemeLookup to get the actual correct color for the
// currently requested theme.
if (const auto bgColor = ThemeLookup(Resources(), requestedTheme, winrt::box_value(bgKey)))
{
SettingsNav().Background(winrt::WUX::Media::SolidColorBrush(winrt::unbox_value<Windows::UI::Color>(bgColor)));
}
Expand Down