actions are good for our keyboard inclined

This commit is contained in:
Mike Griese
2026-05-07 13:41:46 -05:00
parent b9896f51e4
commit 12e2daaeb9
8 changed files with 20 additions and 1 deletions

View File

@@ -1676,4 +1676,14 @@ namespace winrt::TerminalApp::implementation
}
}
void TerminalPage::_HandleWorkspaces(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
if (_workspaceFlyout && _workspaceDropdown)
{
_workspaceFlyout.ShowAt(_workspaceDropdown);
}
args.Handled(true);
}
}

View File

@@ -337,6 +337,7 @@ namespace winrt::TerminalApp::implementation
auto tabRowImpl = winrt::get_self<implementation::TabRowControl>(_tabRow);
_newTabButton = tabRowImpl->NewTabButton();
_workspaceFlyout = tabRowImpl->WorkspaceFlyout();
_workspaceDropdown = tabRowImpl->WorkspaceDropdown();
// Set the initial workspace name from the window name.
// Use raw WindowName() so unnamed windows show no text.

View File

@@ -272,6 +272,7 @@ namespace winrt::TerminalApp::implementation
Windows::UI::Xaml::Controls::Grid _tabContent{ nullptr };
Microsoft::UI::Xaml::Controls::SplitButton _newTabButton{ nullptr };
Windows::UI::Xaml::Controls::MenuFlyout _workspaceFlyout{ nullptr };
Windows::UI::Xaml::Controls::Button _workspaceDropdown{ nullptr };
winrt::TerminalApp::ColorPickupFlyout _tabColorPicker{ nullptr };
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };

View File

@@ -103,6 +103,7 @@ static constexpr std::string_view OpenScratchpadKey{ "experimental.openScratchpa
static constexpr std::string_view OpenAboutKey{ "openAbout" };
static constexpr std::string_view QuickFixKey{ "quickFix" };
static constexpr std::string_view OpenCWDKey{ "openCWD" };
static constexpr std::string_view WorkspacesKey{ "workspaces" };
static constexpr std::string_view ActionKey{ "action" };

View File

@@ -162,6 +162,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{ ShortcutAction::TogglePaneZoom, USES_RESOURCE(L"TogglePaneZoomCommandKey") },
{ ShortcutAction::ToggleShaderEffects, USES_RESOURCE(L"ToggleShaderEffectsCommandKey") },
{ ShortcutAction::ToggleSplitOrientation, USES_RESOURCE(L"ToggleSplitOrientationCommandKey") },
{ ShortcutAction::Workspaces, USES_RESOURCE(L"WorkspacesCommandKey") },
};
}();

View File

@@ -114,7 +114,8 @@
ON_ALL_ACTIONS(OpenAbout) \
ON_ALL_ACTIONS(QuickFix) \
ON_ALL_ACTIONS(OpenCWD) \
ON_ALL_ACTIONS(OpenWorkspace)
ON_ALL_ACTIONS(OpenWorkspace) \
ON_ALL_ACTIONS(Workspaces)
#define ALL_SHORTCUT_ACTIONS_WITH_ARGS \
ON_ALL_ACTIONS_WITH_ARGS(AdjustFontSize) \

View File

@@ -747,6 +747,9 @@
<data name="OpenCWDCommandKey" xml:space="preserve">
<value>Open current working directory</value>
</data>
<data name="WorkspacesCommandKey" xml:space="preserve">
<value>Workspaces...</value>
</data>
<data name="CloseTab" xml:space="preserve">
<value>Close tab</value>
</data>

View File

@@ -542,6 +542,7 @@
{ "command": "quickFix", "id": "Terminal.QuickFix" },
{ "command": { "action": "showSuggestions", "source": "all"}, "id": "Terminal.Suggestions" },
{ "command": "openCWD", "id": "Terminal.OpenCWD" },
{ "command": "workspaces", "id": "Terminal.Workspaces" },
// Tab Management
// "command": "closeTab" is unbound by default.