Skip to content
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/TerminalApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ namespace winrt::TerminalApp::implementation
_OpenNewTab(std::nullopt);

_tabContent.SizeChanged({ this, &App::_OnContentSizeChanged });

_ApplyTheme(_settings->GlobalSettings().GetRequestedTheme());
}

App::~App()
Expand Down Expand Up @@ -153,6 +155,11 @@ namespace winrt::TerminalApp::implementation
// xaml tree somehow.
dialog.XamlRoot(_root.XamlRoot());

// IMPORTANT: Set the requested theme of the dialog, because the
// PopupRoot isn't directly in the Xaml tree of our root. So the dialog
// won't inherit our RequestedTheme automagically.
dialog.RequestedTheme(_settings->GlobalSettings().GetRequestedTheme());

// Display the dialog.
Controls::ContentDialogResult result = co_await dialog.ShowAsync(Controls::ContentDialogPlacement::Popup);

Expand Down Expand Up @@ -740,7 +747,6 @@ namespace winrt::TerminalApp::implementation
// - newTheme: The ElementTheme to apply to our elements.
void App::_ApplyTheme(const Windows::UI::Xaml::ElementTheme& newTheme)
{
_root.RequestedTheme(newTheme);
// Propagate the event to the host layer, so it can update its own UI
_requestedThemeChangedHandlers(*this, newTheme);
}
Expand Down