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 | |
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')
-rw-r--r-- | src/ui/documentwidget.c | 9 | ||||
-rw-r--r-- | src/ui/util.c | 4 |
2 files changed, 11 insertions, 2 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 | ||
diff --git a/src/ui/util.c b/src/ui/util.c index fd297ce2..6615a454 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1043,8 +1043,8 @@ iWidget *makePreferences_Widget(void) { | |||
1043 | appendTwoColumnPage_(tabs, "General", '1', &headings, &values); | 1043 | appendTwoColumnPage_(tabs, "General", '1', &headings, &values); |
1044 | addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:"))); | 1044 | addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:"))); |
1045 | setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads"); | 1045 | setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads"); |
1046 | /*addChild_Widget(headings, iClob(makeHeading_Widget("Outline on scrollbar:"))); | 1046 | addChild_Widget(headings, iClob(makeHeading_Widget("Full link on hover:"))); |
1047 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoveroutline")));*/ | 1047 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); |
1048 | addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:"))); | 1048 | addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:"))); |
1049 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll"))); | 1049 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll"))); |
1050 | addChild_Widget(headings, iClob(makeHeading_Widget("Load image on scroll:"))); | 1050 | addChild_Widget(headings, iClob(makeHeading_Widget("Load image on scroll:"))); |