From a15d85d634a1809ca57395e803813d3b659df2fc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Mar 2024 18:11:25 +0300 Subject: fixes #3660 (NewStory: customizable links' color) --- plugins/NewStory/src/fonts.cpp | 1 + plugins/NewStory/src/fonts.h | 2 +- plugins/NewStory/src/templates.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp index 7345202e67..67d02c30c4 100644 --- a/plugins/NewStory/src/fonts.cpp +++ b/plugins/NewStory/src/fonts.cpp @@ -43,6 +43,7 @@ MyColourID g_colorTable[COLOR_COUNT] = { LPGEN("Quoting"), "Quote", RGB(0x80, 0x80, 0xff) }, { LPGEN("Separator"), "Separator", RGB(0x60, 0x60, 0x60) }, { LPGEN("Progress indicator"), "Progress", RGB(0xff, 0x00, 0x00) }, + { LPGEN("Links"), "Links", RGB(0x00, 0x00, 0xff) }, }; MyFontID g_fontTable[FONT_COUNT] = diff --git a/plugins/NewStory/src/fonts.h b/plugins/NewStory/src/fonts.h index 78c048a018..5c357b5e96 100644 --- a/plugins/NewStory/src/fonts.h +++ b/plugins/NewStory/src/fonts.h @@ -11,7 +11,7 @@ enum COLOR_STATUS, COLOR_INOTHER, COLOR_OUTOTHER, COLOR_SELTEXT, COLOR_SELBACK, COLOR_SELFRAME, - COLOR_HIGHLIGHT_BACK, COLOR_BACK, COLOR_QUOTE, COLOR_FRAME, COLOR_PROGRESS, + COLOR_HIGHLIGHT_BACK, COLOR_BACK, COLOR_QUOTE, COLOR_FRAME, COLOR_PROGRESS, COLOR_LINK, COLOR_COUNT }; diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 26032b2fa1..4212eda602 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -118,7 +118,7 @@ static void AppendString(CMStringW &buf, const wchar_t *p) if (auto *p2 = wcsstr(p, L"[/url]")) { CMStringW wszUrl(p, int(p2 - p)); - buf.AppendFormat(L"%s", wszUrl.c_str(), wszUrl.c_str()); + buf.AppendFormat(L"%s", wszUrl.c_str(), wszUrl.c_str()); p = p2 + 5; } } @@ -146,6 +146,7 @@ CMStringW ItemData::formatHtml(const wchar_t *pwszStr) wchar_t szFont[100]; str.AppendFormat(L"body {margin: 0px; text-align: left; %s; color: NSText; overflow: auto;}\n", font2html(F.lf, szFont)); str.AppendFormat(L".nick {color: #%06X }\n", color2html(g_colorTable[(dbe.flags & DBEF_SENT) ? COLOR_OUTNICK : COLOR_INNICK].cl)); + str.AppendFormat(L".link {color: #%06X }\n", color2html(g_colorTable[COLOR_LINK].cl)); if (qtext) str.AppendFormat(L".quote {border-left: 4px solid #%06X; padding-left: 8px; }\n", color2html(g_colorTable[COLOR_QUOTE].cl)); -- cgit v1.2.3