Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teach tab tool tips to show key bindings #8810

Merged
2 commits merged into from
Jan 19, 2021
Merged

Conversation

Don-Vito
Copy link
Contributor

@Don-Vito Don-Vito commented Jan 16, 2021

PR Checklist

Detailed Description of the Pull Request / Additional comments

Currently the tab tool tip is the tab's title.
The PR teaches the TabBase to check if there is a switch to tab command
associated with the current tab index,
if so concatenates the the relevant mapping to the too tip.

Of course, prefers user defined bindings to the default ones.

Moved tool tip logic to TabBase so SettingsTab has tooltip as well.

TabToolTip

@ghost ghost added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Jan 16, 2021
SwitchToTabArgs args{ _TabViewIndex };
ActionAndArgs switchToTab{ ShortcutAction::SwitchToTab, args };
const auto keyChord = _keymap ? _keymap.GetKeyBindingForActionWithArgs(switchToTab) : nullptr;
const auto keyChordText = keyChord ? KeyChordSerialization::ToString(keyChord) : L"";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird enough, I think we have another keychord->string converter too living in TerminalPage. Not sure which one we should use here. This one used to be used in settings re-serialization, so it was less user-facing.

The one in TerminalApp is admittedly strange. Probably best not to use it.

@DHowett
Copy link
Member

DHowett commented Jan 17, 2021

This is great! Thank you 😄

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 19, 2021
@ghost
Copy link

ghost commented Jan 19, 2021

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 90e7c28 into microsoft:main Jan 19, 2021
@ghost
Copy link

ghost commented Jan 28, 2021

🎉Windows Terminal Preview v1.6.10272.0 has been released which incorporates this pull request.:tada:

Handy links:

mpela81 pushed a commit to mpela81/terminal that referenced this pull request Jan 28, 2021
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes microsoft#2886
* [x] CLA signed. 
* [ ] Tests added/passed
* [ ] Documentation updated. 
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already. 

## Detailed Description of the Pull Request / Additional comments
Currently the tab tool tip is the tab's title.
The PR teaches the TabBase to check if there is a switch to tab command 
associated with the current tab index,
if so concatenates the the relevant mapping to the too tip.

Of course, prefers user defined bindings to the default ones.

Moved tool tip logic to TabBase so SettingsTab has tooltip as well.

![TabToolTip](https://user-images.githubusercontent.com/4639110/104823154-a1cb1100-5850-11eb-9dbd-bf23f5e6979d.gif)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants