From 7ce5ce71c631671061ba13fd30b97075fa5f3e63 Mon Sep 17 00:00:00 2001 From: Mataes Date: Fri, 1 May 2020 18:09:37 +0300 Subject: mtextcontrol: uncomment color bbcode newstory: test bbcode color --- libs/mTextControl/src/fancy_rtf.cpp | 11 +++++++++-- plugins/NewStory/src/templates.cpp | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/mTextControl/src/fancy_rtf.cpp b/libs/mTextControl/src/fancy_rtf.cpp index 8746d2fc65..4fe3cf822b 100644 --- a/libs/mTextControl/src/fancy_rtf.cpp +++ b/libs/mTextControl/src/fancy_rtf.cpp @@ -49,6 +49,13 @@ static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t * case BBS_STRIKEOUT_E: cf.dwMask = CFM_STRIKEOUT; break; + case BBS_COLOR_S: + cf.dwMask = CFM_COLOR; + cf.dwEffects = CFE_AUTOCOLOR; + break; + case BBS_COLOR_E: + cf.dwMask = CFM_COLOR; + break; } ITextServices *ts = ftd->getTextService(); @@ -96,8 +103,8 @@ static BBCodeInfo bbCodes[] = { L"[s]", nullptr, bbCodeSimpleFunc, BBS_STRIKEOUT_S }, { L"[/s]", nullptr, bbCodeSimpleFunc, BBS_STRIKEOUT_E }, - // { L"[color=", L"]", bbCodeSimpleFunc, BBS_COLOR_S }, - // { L"[/color]", 0, bbCodeSimpleFunc, BBS_COLOR_E } + { L"[color=", L"]", bbCodeSimpleFunc, BBS_COLOR_S }, + { L"[/color]", 0, bbCodeSimpleFunc, BBS_COLOR_E }, { L"[$hicon=", L"$]", bbCodeImageFunc, 0 } diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 0ca537a60c..bcd4f5f27d 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -308,7 +308,7 @@ TemplateInfo templates[TPL_COUNT] = { vfGlobal, vfContact, 0, 0, 0 } }, { "tpl/msglog/msg", LPGENW("Message log"), ICO_SENDMSG, LPGENW("Messages"), - L"%I%i[b]%N, %t:[/b]\x0d\x0a%M", 0, 0, + L"%I%i[b][color=red]%N[/color], %t:[/b]\x0d\x0a%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfMessage, 0 } }, { "tpl/msglog/file", LPGENW("Message log"), ICO_FILE, LPGENW("Files"), L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, -- cgit v1.2.3