summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-21 19:46:40 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-21 19:46:40 +0300
commit6732618d43a79bbe309a1cec6165a5ae4022a154 (patch)
treed15d92712365e43c9e345345d0141e47bc849598 /plugins/NewStory/src
parentc1e25c5724629f1315a1043d99272ee8dddfc049 (diff)
NewStory: fix for colors
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r--plugins/NewStory/src/history_array.cpp5
-rw-r--r--plugins/NewStory/src/history_control.cpp6
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp
index 37bfc35ccf..3aef75df2c 100644
--- a/plugins/NewStory/src/history_array.cpp
+++ b/plugins/NewStory/src/history_array.cpp
@@ -458,6 +458,11 @@ void ItemData::load(bool bLoadAlways)
void ItemData::setText()
{
+ int fontid, colorid;
+ getFontColor(fontid, colorid);
+
+ pOwner->webPage.clText = g_fontTable[fontid].cl;
+ pOwner->webPage.clBack = g_colorTable[colorid].cl;
m_doc = litehtml::document::createFromString(T2Utf(formatHtml()), &pOwner->webPage);
}
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index d559085d5f..8d8c849865 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -673,9 +673,6 @@ void NewstoryListData::Paint(simpledib::dib &dib, RECT *rcDraw)
auto *pItem = LoadItem(idx);
pItem->savedTop = top;
- POINT pos;
- int height = pItem->calcHeight(top, cachedWindowWidth, &pos);
-
COLORREF clLine;
int fontid, colorid;
pItem->getFontColor(fontid, colorid);
@@ -696,6 +693,9 @@ void NewstoryListData::Paint(simpledib::dib &dib, RECT *rcDraw)
clLine = g_colorTable[COLOR_FRAME].cl;
}
+ POINT pos;
+ int height = pItem->calcHeight(top, cachedWindowWidth, &pos);
+
HBRUSH hbr = CreateSolidBrush(webPage.clBack);
RECT rc = { 0, top, cachedWindowWidth, top + height };
FillRect(dib, &rc, hbr);