Fix clipped progress ring in tab when tab title is too long#14167
Merged
1 commit merged intomicrosoft:mainfrom Oct 10, 2022
Merged
Fix clipped progress ring in tab when tab title is too long#141671 commit merged intomicrosoft:mainfrom
1 commit merged intomicrosoft:mainfrom
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
DHowett
approved these changes
Oct 10, 2022
Member
DHowett
left a comment
There was a problem hiding this comment.
Thanks for doing this! It seems so straightforward when you lay it out like that...
Member
|
@msftbot merge this in 5 minutes |
|
Hello @carlos-zamora! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
DHowett
pushed a commit
that referenced
this pull request
Oct 13, 2022
It turns out that the negative margin for the progress ring is causing the clipping in case the tab title gets too long: https://github.com/microsoft/terminal/blob/43dbbd590fa4b46c37e9970415f8150d3c399598/src/cascadia/TerminalApp/TabHeaderControl.xaml#L18-L27 The negative margin was introduced in #8113 because the progress ring is supposed to replace the tab icon but the `TabView` still reserves space even if no icon is set (see #8133 (comment)). However, it is not actually the `TabView` reserving space even when there is no icon, but a workaround for a crash in the `IconPathConverter` that returns a `BitmapIconSource` with a `nullptr` source instead of a `nullptr` `IconSource`: https://github.com/microsoft/terminal/blob/43dbbd590fa4b46c37e9970415f8150d3c399598/src/cascadia/TerminalSettingsModel/IconPathConverter.cpp#L143-L154 The workaround in `IconPathConverter` could probably be removed as I did not find any instance where it is still used in a way that could trigger the mentioned crash, but I did not dare to just remove it as I do not know enough about the code by far. Hence, I opted to just locally instantiate the `IconSource` with a `nullptr` directly in `TerminalTab`. Fixes #8910 (cherry picked from commit 21a9c55) Service-Card-Id: 86209056 Service-Version: 1.16
|
🎉 Handy links: |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It turns out that the negative margin for the progress ring is causing
the clipping in case the tab title gets too long:
terminal/src/cascadia/TerminalApp/TabHeaderControl.xaml
Lines 18 to 27 in 43dbbd5
The negative margin was introduced in #8113 because the progress ring is
supposed to replace the tab icon but the
TabViewstill reserves spaceeven if no icon is set (see
#8133 (comment)).
However, it is not actually the
TabViewreserving space even whenthere is no icon, but a workaround for a crash in the
IconPathConverterthat returns aBitmapIconSourcewith anullptrsource instead of a
nullptrIconSource:terminal/src/cascadia/TerminalSettingsModel/IconPathConverter.cpp
Lines 143 to 154 in 43dbbd5
The workaround in
IconPathConvertercould probably be removed as I didnot find any instance where it is still used in a way that could trigger
the mentioned crash, but I did not dare to just remove it as I do not
know enough about the code by far. Hence, I opted to just locally
instantiate the
IconSourcewith anullptrdirectly inTerminalTab.Fixes #8910