Skip to content

Commit 1cc9835

Browse files
committed
feature flags too
1 parent 86914bd commit 1cc9835

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/cascadia/TerminalApp/AppActionHandlers.cpp

+11-8
Original file line numberDiff line numberDiff line change
@@ -1320,15 +1320,18 @@ namespace winrt::TerminalApp::implementation
13201320
void TerminalPage::_HandleOpenScratchpad(const IInspectable& /*sender*/,
13211321
const ActionEventArgs& args)
13221322
{
1323-
auto scratchPane{ winrt::make_self<ScratchpadContent>() };
1323+
if (Feature_ScratchpadPane::IsEnabled())
1324+
{
1325+
auto scratchPane{ winrt::make_self<ScratchpadContent>() };
13241326

1325-
// This is maybe a little wacky - add our key event handler to the pane
1326-
// we made. So that we can get actions for keys that the content didn't
1327-
// handle.
1328-
scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler });
1327+
// This is maybe a little wacky - add our key event handler to the pane
1328+
// we made. So that we can get actions for keys that the content didn't
1329+
// handle.
1330+
scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler });
13291331

1330-
auto resultPane = std::make_shared<Pane>(*scratchPane);
1331-
_SplitPane(SplitDirection::Automatic, 0.5f, resultPane);
1332-
args.Handled(true);
1332+
auto resultPane = std::make_shared<Pane>(*scratchPane);
1333+
_SplitPane(SplitDirection::Automatic, 0.5f, resultPane);
1334+
args.Handled(true);
1335+
}
13331336
}
13341337
}

src/cascadia/TerminalApp/ScratchpadContent.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace winrt::TerminalApp::implementation
2020

2121
auto res = Windows::UI::Xaml::Application::Current().Resources();
2222
auto bg = res.Lookup(winrt::box_value(L"UnfocusedBorderBrush"));
23-
// _root.Background(Media::SolidColorBrush{ winrt::Windows::UI::Colors::Red() });
2423
_root.Background(bg.try_as<Media::Brush>());
2524

2625
_box = winrt::Windows::UI::Xaml::Controls::TextBox{};

src/features.xml

+10
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,14 @@
173173
</alwaysEnabledBrandingTokens>
174174
</feature>
175175

176+
<feature>
177+
<name>Feature_ScratchpadPane</name>
178+
<description>Allow the user to create scratchpad panes. Mostly just exists to validate non-terminal panes.</description>
179+
<id>997</id>
180+
<stage>AlwaysDisabled</stage>
181+
<alwaysEnabledBrandingTokens>
182+
<brandingToken>Dev</brandingToken>
183+
</alwaysEnabledBrandingTokens>
184+
</feature>
185+
176186
</featureStaging>

0 commit comments

Comments
 (0)