Display URI tooltip, render dashed/solid underline for links#7420
Display URI tooltip, render dashed/solid underline for links#7420
Conversation
| if (newId != _lastHoveredId) | ||
| { | ||
| _renderEngine->UpdateHyperlinkHoveredId(newId); | ||
| _renderer->TriggerRedrawAll(); | ||
| _lastHoveredId = newId; | ||
| } |
There was a problem hiding this comment.
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.
(right now we're tracking the last ID in two places)
There was a problem hiding this comment.
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.
(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