From d846849d3bf2c2fa723f19be5f6ec676851e6600 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Fri, 22 Apr 2022 06:45:56 +0300
Subject: [PATCH 1/1] Fixed hovering on links via keyboard
The link info was not updated.
res/about/version.gmi | 1 +
src/ui/documentwidget.c | 17 +++++++++++------
src/ui/labelwidget.c | 10 ++++++++--
3 files changed, 20 insertions(+), 8 deletions(-)
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 @@
+* Fixed hovering on links via the keyboard (default binding: H).
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) {
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;
--
2.25.1
text/plain
This content has been proxied by September (3851b).