From a81d618369225a390609a66322da930a46cda289 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Oct 2024 18:45:43 +0300 Subject: =?UTF-8?q?fixes=20#4724=20(NewStory:=20=D1=81=D0=BE=D0=BE=D0=B1?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=81=D0=B2=D0=B5=D1=82=D0=BA=D0=BE=D0=B9=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B4=D0=B5=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'plugins/NewStory') 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)); -- cgit v1.2.3