Skip to content

Commit

Permalink
feature flags too
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Jul 27, 2023
1 parent 86914bd commit 1cc9835
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/cascadia/TerminalApp/AppActionHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
1 change: 0 additions & 1 deletion src/cascadia/TerminalApp/ScratchpadContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{};
Expand Down
10 changes: 10 additions & 0 deletions src/features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 1cc9835

Please sign in to comment.