summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2020-05-01 18:09:37 +0300
committerMataes <mataes2007@gmail.com>2020-05-01 18:09:37 +0300
commit7ce5ce71c631671061ba13fd30b97075fa5f3e63 (patch)
tree3b7c2536e9ec8e4b30a8a2468ca4aee9bf0f28cc
parent77c1864bf0b2b2085cd55f4413e860f3b433fa2f (diff)
mtextcontrol: uncomment color bbcode
newstory: test bbcode color
-rw-r--r--libs/mTextControl/src/fancy_rtf.cpp11
-rw-r--r--plugins/NewStory/src/templates.cpp2
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,