From d81997194e74b2e0c207cc9dd7cafde845fcf390 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 19 Sep 2021 12:41:44 +0300 Subject: [PATCH] Allow forcing links to be always underlined. --- ui/basic.style | 1 + ui/text/text.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/basic.style b/ui/basic.style index 593ebbd..5a79615 100644 --- a/ui/basic.style +++ b/ui/basic.style @@ -14,6 +14,7 @@ TextPalette { selectLinkFg: color; selectMonoFg: color; selectOverlay: color; + linkAlwaysActive: int; } TextStyle { diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 6db3e73..6cbb18a 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -2018,7 +2018,10 @@ private: const auto flags = block->flags(); const auto usedFont = [&] { if (const auto index = block->lnkIndex()) { - return ClickHandler::showAsActive(_t->_links.at(index - 1)) + const auto active = ClickHandler::showAsActive( + _t->_links.at(index - 1) + ) || (_textPalette && _textPalette->linkAlwaysActive > 0); + return active ? _t->_st->linkFontOver : _t->_st->linkFont; }