From 001e8651ace0919fc8d0a8815f69ae9b7297bf89 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 21 Mar 2025 14:43:19 +0300 Subject: =?UTF-8?q?fixes=20#4861=20(NewStory:=20=D0=9E=D0=BF=D1=8F=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BF=D0=BE=D0=BB=D0=BE=D1=81=D0=BA=D0=B0=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=D0=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index ac0753693d..ee3ba8daec 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -780,7 +780,8 @@ void NewstoryListData::Paint(simpledib::dib &dib) SetBkMode(dib, TRANSPARENT); // left offset of icons & text - int xPos = 2, yPos = top + 2, xRight = 0, yOffset = 0; + bool bDrawProgress = false; + int xPos = 2, yPos = top + 2, xRight = 0; if (!bReadOnly) { HICON hIcon; @@ -840,13 +841,8 @@ void NewstoryListData::Paint(simpledib::dib &dib) if (pItem->m_bOfflineDownloaded != 0) { if (pItem->completed()) DrawIconEx(dib, cachedWindowWidth - (xRight = 20), yPos, g_plugin.getIcon(IDI_OK), 16, 16, 0, 0, DI_NORMAL); - else { - HPEN hpn = (HPEN)SelectObject(dib, CreatePen(PS_SOLID, 4, g_colorTable[COLOR_PROGRESS].cl)); - MoveToEx(dib, rc.left, rc.bottom - 4, 0); - LineTo(dib, rc.left + (rc.right - rc.left) * int(pItem->m_bOfflineDownloaded) / 100, rc.bottom - 4); - DeleteObject(SelectObject(dib, hpn)); - yOffset = 4; - } + else + bDrawProgress = true; } // Delivered & remote read icons @@ -857,7 +853,7 @@ void NewstoryListData::Paint(simpledib::dib &dib) } // draw html itself - litehtml::position clip(xPos, yPos, cachedWindowWidth - xPos - xRight, iItemHeigth - yOffset); + 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(); @@ -870,6 +866,14 @@ void NewstoryListData::Paint(simpledib::dib &dib) pDoc->draw((UINT_PTR)dib.hdc(), xPos, yPos + iOffsetY, &clip); } + // draw progress + if (bDrawProgress) { + HPEN hpn = (HPEN)SelectObject(dib, CreatePen(PS_SOLID, 4, g_colorTable[COLOR_PROGRESS].cl)); + MoveToEx(dib, rc.left, rc.bottom - 4, 0); + LineTo(dib, rc.left + (rc.right - rc.left) * int(pItem->m_bOfflineDownloaded) / 100, rc.bottom - 4); + DeleteObject(SelectObject(dib, hpn)); + } + // draw border HPEN hpn = (HPEN)SelectObject(dib, CreatePen(PS_SOLID, 1, clLine)); MoveToEx(dib, rc.left, rc.bottom - 1, 0); -- cgit v1.2.3