diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-18 17:34:55 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-18 17:34:55 +0200 |
| commit | 479d1226faaa937ef6820b14f36099ef3f575883 (patch) | |
| tree | 10e5560fb8bae6c317ca06564c9609c3c498503e /alf/alflabel.cpp | |
| parent | 4054b17c661d2e709895e8235e9dce6edaa61e4f (diff) | |
implement background color
reduce flickering by keeping pixels if we know the background didn't change
panel text is now gone, it would require us to redraw every transparent
widget on top, which is a bad tradeoff since that panel text isn't very
useful anyway.
Diffstat (limited to 'alf/alflabel.cpp')
| -rw-r--r-- | alf/alflabel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp index 59c92fa..f424486 100644 --- a/alf/alflabel.cpp +++ b/alf/alflabel.cpp @@ -203,6 +203,19 @@ ALF__LabelWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ReleaseDC(hwnd, hdcLabel); } + } else if (uMsg == WM_WINDOWPOSCHANGED) { + WINDOWPOS *p = (WINDOWPOS *)lParam; + if (!(p->flags & SWP_NOSIZE)) { + // for left-top aligned labels, no redraw is necessary + // right/bottom/center alignment basically needs to redraw the whole thing + DWORD halign = priv->style & ALF_LABEL_HALIGN_MASK; + DWORD valign = priv->style & ALF_LABEL_VALIGN_MASK; + + if ((halign != ALF_LABEL_ALIGN_LEFT && halign != ALF_LABEL_ALIGN_LEFT_LIKE_EDIT) + || (valign != ALF_LABEL_ALIGN_TOP && valign != ALF_LABEL_ALIGN_TOP_LIKE_EDIT)) { + InvalidateRect(hwnd, NULL, TRUE); + } + } } else if (uMsg == WM_DESTROY) { ALF_Free(priv); SetWindowLongPtr(hwnd, 0, 0); |
