-
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
Display URI tooltip, render dashed/solid underline for links #7420
Conversation
…ev/pabhoj/osc8_support
if (newId != _lastHoveredId) | ||
{ | ||
_renderEngine->UpdateHyperlinkHoveredId(newId); | ||
_renderer->TriggerRedrawAll(); | ||
_lastHoveredId = newId; | ||
} |
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.
I'm wondering if this logic (check equality, store last hovered ID, trigger redraw) all belongs inside UpdateHyperlinkHoveredId
. Is that bad for the render engine contract @miniksa?
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.
(right now we're tracking the last ID in two places)
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.
Ugh its frustrating. The problem is that the specific engine has no way of signaling the renderer base to do the redraw all operation. When I originally laid it out, it was supposed to be getting commands inbound only.
This isn't that far off from us storing the invalid regions or cursor positions in multiple places. For instance, some of the renderers remember the last cursor pos they drew so they can erase the cursor "turds". Yes, it's two places... but there's precedent and I'm not sure what else is to be done beyond rearchitecting, which is out of scope.
if (newId != _lastHoveredId) | ||
{ | ||
_renderEngine->UpdateHyperlinkHoveredId(newId); | ||
_renderer->TriggerRedrawAll(); | ||
_lastHoveredId = newId; | ||
} |
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.
(right now we're tracking the last ID in two places)
🎉 Handy links: |
Summary of the Pull Request
References
#5001
PR Checklist
Detailed Description of the Pull Request / Additional comments
TermControl now has a canvas that contains a tiny border to which a tooltip is attached. When we hover over hyperlinked text, we move the border to the mouse location and update the tooltip content with the URI.
Introduced a new underline type (HyperlinkUnderline), supports rendering for it, and uses it to render hyperlinks. HyperlinkUnderline is usually a dashed underline, but when a link is hovered, all text with the same hyperlink ID is rendered with a solid underline.
Validation Steps Performed