From 1cc9835454acbeef1b82a11ea7aea97b4d6e34c0 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 27 Jul 2023 13:58:44 -0500 Subject: [PATCH] feature flags too --- .../TerminalApp/AppActionHandlers.cpp | 19 +++++++++++-------- .../TerminalApp/ScratchpadContent.cpp | 1 - src/features.xml | 10 ++++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/cascadia/TerminalApp/AppActionHandlers.cpp b/src/cascadia/TerminalApp/AppActionHandlers.cpp index 8c7832e5df6..d7004cb5758 100644 --- a/src/cascadia/TerminalApp/AppActionHandlers.cpp +++ b/src/cascadia/TerminalApp/AppActionHandlers.cpp @@ -1320,15 +1320,18 @@ namespace winrt::TerminalApp::implementation void TerminalPage::_HandleOpenScratchpad(const IInspectable& /*sender*/, const ActionEventArgs& args) { - auto scratchPane{ winrt::make_self() }; + if (Feature_ScratchpadPane::IsEnabled()) + { + auto scratchPane{ winrt::make_self() }; - // This is maybe a little wacky - add our key event handler to the pane - // we made. So that we can get actions for keys that the content didn't - // handle. - scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler }); + // This is maybe a little wacky - add our key event handler to the pane + // we made. So that we can get actions for keys that the content didn't + // handle. + scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler }); - auto resultPane = std::make_shared(*scratchPane); - _SplitPane(SplitDirection::Automatic, 0.5f, resultPane); - args.Handled(true); + auto resultPane = std::make_shared(*scratchPane); + _SplitPane(SplitDirection::Automatic, 0.5f, resultPane); + args.Handled(true); + } } } diff --git a/src/cascadia/TerminalApp/ScratchpadContent.cpp b/src/cascadia/TerminalApp/ScratchpadContent.cpp index a2a0f5dc921..6dc690448e8 100644 --- a/src/cascadia/TerminalApp/ScratchpadContent.cpp +++ b/src/cascadia/TerminalApp/ScratchpadContent.cpp @@ -20,7 +20,6 @@ namespace winrt::TerminalApp::implementation auto res = Windows::UI::Xaml::Application::Current().Resources(); auto bg = res.Lookup(winrt::box_value(L"UnfocusedBorderBrush")); - // _root.Background(Media::SolidColorBrush{ winrt::Windows::UI::Colors::Red() }); _root.Background(bg.try_as()); _box = winrt::Windows::UI::Xaml::Controls::TextBox{}; diff --git a/src/features.xml b/src/features.xml index adb444b65fb..ed8af5fdcb6 100644 --- a/src/features.xml +++ b/src/features.xml @@ -173,4 +173,14 @@ + + Feature_ScratchpadPane + Allow the user to create scratchpad panes. Mostly just exists to validate non-terminal panes. + 997 + AlwaysDisabled + + Dev + + +