From 5e9d0b8195930e831cf29be830b3bfc827d50018 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Wed, 22 Sep 2021 15:49:41 -0500 Subject: [PATCH] use the background from the control when we can --- .../TerminalApp/AdminWarningPlaceholder.cpp | 7 ++ .../TerminalApp/AdminWarningPlaceholder.xaml | 93 +++++++++++-------- src/cascadia/TerminalApp/TerminalPage.cpp | 7 +- src/cascadia/TerminalControl/TermControl.cpp | 5 + src/cascadia/TerminalControl/TermControl.h | 2 + src/cascadia/TerminalControl/TermControl.idl | 2 + .../WslDistroGenerator.cpp | 2 +- 7 files changed, 73 insertions(+), 45 deletions(-) diff --git a/src/cascadia/TerminalApp/AdminWarningPlaceholder.cpp b/src/cascadia/TerminalApp/AdminWarningPlaceholder.cpp index 01bd65cbf..396c72473 100644 --- a/src/cascadia/TerminalApp/AdminWarningPlaceholder.cpp +++ b/src/cascadia/TerminalApp/AdminWarningPlaceholder.cpp @@ -15,6 +15,13 @@ namespace winrt::TerminalApp::implementation _Commandline{ cmdline } { InitializeComponent(); + // If the content we're hosting is a TermControl, then use the control's + // BG as our BG, to give the impression that it's there, under the + // dialog. + if (const auto termControl{ control.try_as() }) + { + RootGrid().Background(termControl.BackgroundBrush()); + } } void AdminWarningPlaceholder::_primaryButtonClick(winrt::Windows::Foundation::IInspectable const& /*sender*/, RoutedEventArgs const& e) diff --git a/src/cascadia/TerminalApp/AdminWarningPlaceholder.xaml b/src/cascadia/TerminalApp/AdminWarningPlaceholder.xaml index e417d124b..6fa544c50 100644 --- a/src/cascadia/TerminalApp/AdminWarningPlaceholder.xaml +++ b/src/cascadia/TerminalApp/AdminWarningPlaceholder.xaml @@ -11,50 +11,63 @@ xmlns:mux="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d"> - - - - + - + + + + + - + - - -