diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-10 19:20:09 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-10 19:21:05 +0200 |
commit | 209b1d96b0c5c63ee78601938a32eaa9fa52512e (patch) | |
tree | 9597d8ab54d3029096b88cff2a5379d29668499b /src/ui/documentwidget.c | |
parent | 5472891b5711138d3c54bd90508720a935c36de7 (diff) |
Option to show full URL when hovering on a link
The URL is shown in the bottom of the page.
IssueID #64
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 78624c7a..9d284840 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -3194,6 +3194,15 @@ static void draw_DocumentWidget_(const iDocumentWidget *d) { | |||
3194 | tmBackground_ColorId); | 3194 | tmBackground_ColorId); |
3195 | } | 3195 | } |
3196 | drawSideElements_DocumentWidget_(d); | 3196 | drawSideElements_DocumentWidget_(d); |
3197 | if (prefs_App()->hoverLink && d->hoverLink) { | ||
3198 | const int font = uiLabel_FontId; | ||
3199 | const iRangecc linkUrl = range_String(linkUrl_GmDocument(d->doc, d->hoverLink->linkId)); | ||
3200 | const iInt2 size = measureRange_Text(font, linkUrl); | ||
3201 | const iRect linkRect = { addY_I2(bottomLeft_Rect(bounds), -size.y), | ||
3202 | addX_I2(size, 2 * gap_UI) }; | ||
3203 | fillRect_Paint(&ctx.paint, linkRect, tmBackground_ColorId); | ||
3204 | drawRange_Text(font, addX_I2(topLeft_Rect(linkRect), gap_UI), tmParagraph_ColorId, linkUrl); | ||
3205 | } | ||
3197 | draw_Widget(w); | 3206 | draw_Widget(w); |
3198 | } | 3207 | } |
3199 | 3208 | ||