Skip to content

Commit

Permalink
Inform user that holding alt opens a new pane (#7866)
Browse files Browse the repository at this point in the history
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 <pabhojwa@microsoft.com>
(cherry picked from commit 8d12388)
  • Loading branch information
PankajBhojwani authored and DHowett committed Oct 19, 2020
1 parent ef5198e commit fd1afae
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cascadia/TerminalApp/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@
<data name="NewTabSplitButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>New Tab</value>
</data>
<data name="NewTabSplitButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>New Tab</value>
<data name="NewTabRun.Text" xml:space="preserve">
<value>Open a new tab</value>
</data>
<data name="NewPaneRun.Text" xml:space="preserve">
<value>Alt+Click to split the current window</value>
</data>
<data name="WindowCloseButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Close</value>
Expand Down
10 changes: 10 additions & 0 deletions src/cascadia/TerminalApp/TabRowControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<ToolTipService.ToolTip>
<ToolTip Placement="Mouse">
<TextBlock IsTextSelectionEnabled="False">
<Run x:Uid="NewTabRun"/> <LineBreak />
<Run x:Uid="NewPaneRun"
FontStyle="Italic">
</Run>
</TextBlock>
</ToolTip>
</ToolTipService.ToolTip>
<!-- U+E710 is the fancy plus icon. -->
<mux:SplitButton.Resources>
<!-- Override the SplitButton* resources to match the tab view's button's styles. -->
Expand Down
15 changes: 15 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() })
{
Expand Down

0 comments on commit fd1afae

Please sign in to comment.