Skip to content

Commit

Permalink
PRE-MERGE #14644 Use ThemeLookup for the SUI bg too
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Jan 14, 2023
2 parents 94368e2 + d6495d8 commit 07146b9
Showing 1 changed file with 7 additions and 1 deletion.
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 @@ -679,12 +680,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

0 comments on commit 07146b9

Please sign in to comment.