summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-29 13:06:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-29 13:06:43 +0300
commit408e61f8f8e4bd0fd52085125da26bb5c425260e (patch)
treeab6b365272f179c99ecb824b87c8e0990825ebe3
parentfe2fa8bb4dd84270bdc716e37a7d189c5aa5bb74 (diff)
fixes #4997 (NewStory: текст с форматированием игнорирует настройки цвета)
-rw-r--r--plugins/NewStory/src/history_control.cpp17
-rw-r--r--plugins/NewStory/src/templates.cpp4
2 files changed, 17 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index bea9d73618..bbfda96e28 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -864,11 +864,20 @@ void NewstoryListData::Paint(simpledib::dib &dib)
litehtml::position clip(xPos, yPos, cachedWindowWidth - xPos - xRight, iItemHeigth);
if (auto &pDoc = pItem->m_doc) {
if (auto pBody = pDoc->root()->select_one("body")) {
- litehtml::background back = pBody->css().get_bg();
- back.m_color = litehtml::web_color(GetRValue(clBack), GetGValue(clBack), GetBValue(clBack));
- pBody->css_w().set_bg(back);
+ if (auto pBbody = pBody->select_one("[id=bbody]")) {
+ litehtml::background back = pBbody->css().get_bg();
+ back.m_color = litehtml::web_color(GetRValue(clBack), GetGValue(clBack), GetBValue(clBack));
- pBody->css_w().set_color(litehtml::web_color(GetRValue(clText), GetGValue(clText), GetBValue(clText)));
+ litehtml::web_color fore(GetRValue(clText), GetGValue(clText), GetBValue(clText));
+
+ pBbody->css_w().set_bg(back);
+ pBbody->css_w().set_color(fore);
+
+ for (auto &it : pBbody->children()) {
+ it->css_w().set_bg(back);
+ it->css_w().set_color(fore);
+ }
+ }
}
pDoc->draw((UINT_PTR)dib.hdc(), xPos, yPos + iOffsetY, &clip);
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index 7e3cb22d8c..2809c36003 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -319,7 +319,11 @@ CMStringW ItemData::formatHtml(const wchar_t *pwszStr)
CMStringW szBody(wszOrigText);
UrlAutodetect(szBody);
+
+ str.Append(L"<div id=\"bbody\">");
AppendString(str, szBody, this);
+ str.Append(L"</div>");
+
if (spRes) {
int iOffset = 0;
for (int i = 0; i < (int)sp.numSmileys; i++) {