diff --git a/res/about/version.gmi b/res/about/version.gmi index ab76277b..af4ecd81 100644 --- a/res/about/version.gmi +++ b/res/about/version.gmi @@ -8,6 +8,7 @@  ## 1.12.2 * Fixed positioning of the language translation dialog's progress animation. +* Fixed hovering on links via the keyboard (default binding: H). * Tab buttons use theme background color with light Oceanic to avoid a color clash. * Feed refresh indicator uses the accent color. * Updated UI translations. diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index f757d4c5..a7920e5d 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -727,6 +727,15 @@ static void invalidateWideRunsWithNonzeroOffset_DocumentView_(iDocumentView *d) } }  +static void updateHoverLinkInfo_DocumentView_(iDocumentView *d) { + if (update_LinkInfo(d->owner->linkInfo, + d->doc, + d->hoverLink ? d->hoverLink->linkId : 0, + width_Widget(constAs_Widget(d->owner)))) { + animate_DocumentWidget_(d->owner); + }  +} + static void updateHover_DocumentView_(iDocumentView *d, iInt2 mouse) { const iWidget *w = constAs_Widget(d->owner); const iRect docBounds = documentBounds_DocumentView_(d); @@ -752,12 +761,7 @@ static void updateHover_DocumentView_(iDocumentView *d, iInt2 mouse) { if (d->hoverLink) { invalidateLink_DocumentView_(d, d->hoverLink->linkId); } - if (update_LinkInfo(d->owner->linkInfo, - d->doc, - d->hoverLink ? d->hoverLink->linkId : 0, - width_Widget(w))) { - animate_DocumentWidget_(d->owner); - } + updateHoverLinkInfo_DocumentView_(d); refresh_Widget(w); } /* Hovering over preformatted blocks. */ @@ -4981,6 +4985,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e visibleLinkOrdinal_DocumentView_(view, run->linkId) == ord) { if (d->flags & setHoverViaKeys_DocumentWidgetFlag) { view->hoverLink = run; + updateHoverLinkInfo_DocumentView_(view); } else { postCommandf_Root( diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 78d38479..aa68225b 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c @@ -244,11 +244,17 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int const enum iGmDocumentTheme docTheme = docTheme_Prefs(prefs_App()); if (areTabButtonsThemeColored_() && !cmp_String(&d->widget.parent->id, "tabs.buttons")) { - *bg = (docTheme == sepia_GmDocumentTheme && - colorTheme_App() == pureWhite_ColorTheme + *bg = (docTheme == oceanic_GmDocumentTheme || + (docTheme == sepia_GmDocumentTheme && + colorTheme_App() == pureWhite_ColorTheme) ? tmBackground_ColorId : tmBannerBackground_ColorId); isThemeBackground = iTrue; + /* Ensure visibility in case the background matches UI background. */ + if (delta_Color(get_Color(*bg), get_Color(uiBackground_ColorId)) < 30) { + *bg = uiBackgroundSelected_ColorId; + isThemeBackground = iFalse; + } } else { *bg = uiBackgroundSelected_ColorId;