diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-26 18:11:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-26 18:11:25 +0300 |
commit | a15d85d634a1809ca57395e803813d3b659df2fc (patch) | |
tree | f4ff492da5f75d8bf6b1ea15c1c0728992aa4321 | |
parent | 1adcb519ac395a83979c72f3cfd7e1f9e01d4962 (diff) |
fixes #3660 (NewStory: customizable links' color)
-rw-r--r-- | plugins/NewStory/src/fonts.cpp | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/fonts.h | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 3 |
3 files changed, 4 insertions, 2 deletions
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"<a href =\"%s\">%s</a>", wszUrl.c_str(), wszUrl.c_str());
+ buf.AppendFormat(L"<a class=\"link\" href = \"%s\">%s</a>", 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));
|