From 738b46633daefae7a2fc4c1fa54914fe1924fe8d Mon Sep 17 00:00:00 2001 From: Krzysztof Kowalczyk Date: Tue, 13 Aug 2024 22:47:53 +0200 Subject: [PATCH] rename VirtWnd::Draw() => Paint() --- src/HomePage.cpp | 6 +++--- src/wingui/VirtWnd.cpp | 2 +- src/wingui/VirtWnd.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/HomePage.cpp b/src/HomePage.cpp index cddedc3e512b..d1eee2ae387b 100644 --- a/src/HomePage.cpp +++ b/src/HomePage.cpp @@ -190,7 +190,7 @@ static Rect DrawHideFrequentlyReadLink(HWND hwnd, HDC hdc, const char* txt) { PositionRB(rc, r); MoveXY(r, -innerPadding, -innerPadding); w.SetBounds(r); - w.Draw(hdc); + w.Paint(hdc); // make the click target larger r.Inflate(innerPadding, innerPadding); @@ -867,7 +867,7 @@ static void DrawHomePageLayout(const HomePageLayout& l) { color = ThemeWindowTextColor(); SetTextColor(hdc, color); - l.freqRead->Draw(hdc); + l.freqRead->Paint(hdc); SelectObject(hdc, GetStockBrush(NULL_BRUSH)); for (const ThumbnailLayout& thumb : l.thumbnails) { @@ -913,7 +913,7 @@ static void DrawHomePageLayout(const HomePageLayout& l) { int openIconIdx = 0; ImageList_Draw(l.himlOpen, openIconIdx, hdc, x, y, ILD_NORMAL); - l.openDoc->Draw(hdc); + l.openDoc->Paint(hdc); if (false) { Rect rcFreqRead = DrawHideFrequentlyReadLink(win->hwndCanvas, hdc, _TRA("Hide frequently read")); diff --git a/src/wingui/VirtWnd.cpp b/src/wingui/VirtWnd.cpp index bfd137810c8f..8ca6213ebbae 100644 --- a/src/wingui/VirtWnd.cpp +++ b/src/wingui/VirtWnd.cpp @@ -83,7 +83,7 @@ Size VirtWndText::GetIdealSize(bool onlyIfEmpty) { return sz; } -void VirtWndText::Draw(HDC hdc) { +void VirtWndText::Paint(HDC hdc) { ReportIf(lastBounds.IsEmpty()); COLORREF prevCol = kColorUnset; int prevBkMode = 0; diff --git a/src/wingui/VirtWnd.h b/src/wingui/VirtWnd.h index 7a2d08284a10..eb69ffeb247b 100644 --- a/src/wingui/VirtWnd.h +++ b/src/wingui/VirtWnd.h @@ -14,7 +14,7 @@ struct VirtWnd : LayoutBase { virtual Size GetIdealSize(); - void Paint(HDC); + virtual void Paint(HDC); VirtWnd* next = nullptr; VirtWnd* firstChild = nullptr; @@ -46,5 +46,6 @@ struct VirtWndText : VirtWnd { Size MinIntrinsicSize(int width, int height); Size GetIdealSize(bool onlyIfEmpty = false); - void Draw(HDC dc); + + void Paint(HDC dc) override; };