-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Set Tab tooltip explicitly #8298
Conversation
Hi - I'd like to give my humble comments from a non-reviewer if you don't mind:
|
@mpela81 From my experience it won't work if I don't use |
This will probably need to be updated for the new TabHeaderControl! 😄 |
Hey thanks for putting this together - mind merging |
I will update it for the new TabHeaderControl. |
@DHowett I updated for TabHeaderControl! |
@@ -290,7 +290,6 @@ namespace winrt::TerminalApp::implementation | |||
Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e) | |||
{ | |||
auto key = e.OriginalKey(); | |||
auto const ctrlDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Control), CoreVirtualKeyStates::Down); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't seem related to fixing the tooltip in the tab header!
newTabRun.Text(tabTitle); | ||
auto textBlock = WUX::Controls::TextBlock{}; | ||
textBlock.Inlines().Append(newTabRun); | ||
toolTip.Content(textBlock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might be able to get away with tooltip.Content(winrt::box_value(tabTitle))
and avoid the Run and TextBlock completely. Does that work?
@@ -231,6 +242,7 @@ namespace winrt::TerminalApp::implementation | |||
|
|||
// Update the control to reflect the changed title | |||
_headerControl.Title(activeTitle); | |||
_SetToolTip(_GetActiveTitle()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this is called at all the right times? How about during initialization when we set the first title
@DHowett I hope this is what you meant! |
Notes from playing with the branch:
Additionally |
It seems like putting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thank you!
@@ -71,6 +70,13 @@ namespace winrt::TerminalApp::implementation | |||
_RecalculateAndApplyTabColor(); | |||
} | |||
|
|||
void TerminalTab::_SetToolTip(const winrt::hstring& tabTitle) | |||
{ | |||
auto toolTip = WUX::Controls::ToolTip{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto toolTip = WUX::Controls::ToolTip{}; | |
WUX::Controls::ToolTip toolTip{}; |
optional change to improve code readability. we usually don't use "auto x = type{y}" because auto is only good when you don't have to say the type. type x{y};
is shorter 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks!
Hello @zadjii-msft! Because this pull request has the 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 (
|
🎉 Handy links: |
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request The tab tooltip is no longer empty when it was toggle zoomed. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes microsoft#8199 * [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
Summary of the Pull Request
The tab tooltip is no longer empty when it was toggle zoomed.
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed