From fd1afae214284a67e8af3cedd6bb9291d2192993 Mon Sep 17 00:00:00 2001 From: PankajBhojwani Date: Mon, 12 Oct 2020 20:14:02 -0400 Subject: [PATCH] Inform user that holding alt opens a new pane (#7866) Adds a tooltip to the new tab button and menu to let the user know that holding alt will open a new pane instead. Fixes #7851 Co-authored-by: Pankaj Bhojwani (cherry picked from commit 8d12388915a14f23ae0b905dfb92bcc124bad5b4) --- .../TerminalApp/Resources/en-US/Resources.resw | 7 +++++-- src/cascadia/TerminalApp/TabRowControl.xaml | 10 ++++++++++ src/cascadia/TerminalApp/TerminalPage.cpp | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw index 15f42ebb3f6..8ab33705c61 100644 --- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw @@ -291,8 +291,11 @@ New Tab - - New Tab + + Open a new tab + + + Alt+Click to split the current window Close diff --git a/src/cascadia/TerminalApp/TabRowControl.xaml b/src/cascadia/TerminalApp/TabRowControl.xaml index e5fc2253d84..503a805984c 100644 --- a/src/cascadia/TerminalApp/TabRowControl.xaml +++ b/src/cascadia/TerminalApp/TabRowControl.xaml @@ -34,6 +34,16 @@ the MIT License. See LICENSE in the project root for license information. --> BorderThickness="0" CornerRadius="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}" AutomationProperties.AccessibilityView="Control"> + + + + + + + + + diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index ec4e0a9b5d4..91b0f40e455 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -496,6 +496,21 @@ namespace winrt::TerminalApp::implementation profileMenuItem.FontWeight(FontWeights::Bold()); } + auto newTabRun = WUX::Documents::Run(); + newTabRun.Text(RS_(L"NewTabRun/Text")); + auto newPaneRun = WUX::Documents::Run(); + newPaneRun.Text(RS_(L"NewPaneRun/Text")); + newPaneRun.FontStyle(FontStyle::Italic); + + auto textBlock = WUX::Controls::TextBlock{}; + textBlock.Inlines().Append(newTabRun); + textBlock.Inlines().Append(WUX::Documents::LineBreak{}); + textBlock.Inlines().Append(newPaneRun); + + auto toolTip = WUX::Controls::ToolTip{}; + toolTip.Content(textBlock); + WUX::Controls::ToolTipService::SetToolTip(profileMenuItem, toolTip); + profileMenuItem.Click([profileIndex, weakThis{ get_weak() }](auto&&, auto&&) { if (auto page{ weakThis.get() }) {