feature flags too

This commit is contained in:
Mike Griese
2023-07-27 13:58:44 -05:00
parent 86914bdfc1
commit 1cc9835454
3 changed files with 21 additions and 9 deletions

View File

@@ -1320,15 +1320,18 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_HandleOpenScratchpad(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
auto scratchPane{ winrt::make_self<ScratchpadContent>() };
if (Feature_ScratchpadPane::IsEnabled())
{
auto scratchPane{ winrt::make_self<ScratchpadContent>() };
// 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<Pane>(*scratchPane);
_SplitPane(SplitDirection::Automatic, 0.5f, resultPane);
args.Handled(true);
auto resultPane = std::make_shared<Pane>(*scratchPane);
_SplitPane(SplitDirection::Automatic, 0.5f, resultPane);
args.Handled(true);
}
}
}

View File

@@ -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<Media::Brush>());
_box = winrt::Windows::UI::Xaml::Controls::TextBox{};

View File

@@ -173,4 +173,14 @@
</alwaysEnabledBrandingTokens>
</feature>
<feature>
<name>Feature_ScratchpadPane</name>
<description>Allow the user to create scratchpad panes. Mostly just exists to validate non-terminal panes.</description>
<id>997</id>
<stage>AlwaysDisabled</stage>
<alwaysEnabledBrandingTokens>
<brandingToken>Dev</brandingToken>
</alwaysEnabledBrandingTokens>
</feature>
</featureStaging>