summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-10 18:45:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-10 18:45:43 +0300
commita81d618369225a390609a66322da930a46cda289 (patch)
treee004a6de98a3d33920a9bbed074045fba0ba279c /plugins/NewStory
parent14ffb1622133f8f7edfb5c35f898dd9d9eab7359 (diff)
fixes #4724 (NewStory: сообщение с подсветкой не выделяется)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history_control.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 1e93bb2197..abe8a6cae3 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -704,7 +704,7 @@ void NewstoryListData::Paint(simpledib::dib &dib)
if (pItem->m_bHighlighted) {
webPage.clText = g_fontTable[FONT_HIGHLIGHT].cl;
- webPage.clBack = g_colorTable[COLOR_HIGHLIGHT_BACK].cl;
+ webPage.clBack = g_colorTable[pItem->m_bSelected ? COLOR_SELBACK : COLOR_HIGHLIGHT_BACK].cl;
clLine = g_colorTable[COLOR_FRAME].cl;
}
else if (pItem->m_bSelected && !bReadOnly) {
@@ -794,8 +794,17 @@ void NewstoryListData::Paint(simpledib::dib &dib)
// draw html itself
litehtml::position clip(xPos, yPos, cachedWindowWidth - xPos, iItemHeigth);
- if (pItem->m_doc)
- pItem->m_doc->draw((UINT_PTR)dib.hdc(), xPos, yPos + iOffsetY, &clip);
+ 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(webPage.clBack), GetGValue(webPage.clBack), GetBValue(webPage.clBack));
+ pBody->css_w().set_bg(back);
+
+ pBody->css_w().set_color(litehtml::web_color(GetRValue(webPage.clText), GetGValue(webPage.clText), GetBValue(webPage.clText)));
+ }
+
+ pDoc->draw((UINT_PTR)dib.hdc(), xPos, yPos + iOffsetY, &clip);
+ }
// draw border
HPEN hpn = (HPEN)SelectObject(dib, CreatePen(PS_SOLID, 1, clLine));