diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-03-21 14:43:19 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-03-21 14:43:19 +0300 |
| commit | 001e8651ace0919fc8d0a8815f69ae9b7297bf89 (patch) | |
| tree | 49c2d290d250428db4a11d8a51f66ed6bc949b8b | |
| parent | 2d2fa8dd248ba2e3e22f13533fef4c69bfbc3c2b (diff) | |
fixes #4861 (NewStory: Опять полоска загрузки файла перекрыта сообщением)
| -rw-r--r-- | plugins/NewStory/src/history_control.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
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);
|
