summaryrefslogtreecommitdiff
path: root/alf
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-29 23:51:31 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-29 23:51:31 +0200
commit2ec1b0cede1a2395bd4d70625b646b46dfb580d6 (patch)
tree7c7fd3d154453f6489052c2131ed2566bf54df38 /alf
parentc9ebff8e7de093e7705aab6208593fae048ad98d (diff)
label: switch to ALF_Compat_DrawDisabledText
Diffstat (limited to 'alf')
-rw-r--r--alf/alflabel.cpp39
1 files changed, 1 insertions, 38 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index e7e2ee3..6290ec7 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -44,21 +44,6 @@ ALF__LabelLeftPadding(HWND hwnd, HDC hdc, ALFLabelPriv *priv)
return p;
}
-static BOOL CALLBACK
-ALF__Label_Text_DrawStateProc(HDC hdc, LPARAM lData, WPARAM wData, int cx, int cy)
-{
- (void)wData;
-
- int oldBkMode = SetBkMode(hdc, TRANSPARENT);
-
- RECT r = { 0, 0, cx, cy };
- DrawText(hdc, (TCHAR*)lData, -1, &r, (UINT)wData);
-
- SetBkMode(hdc, oldBkMode);
-
- return TRUE;
-}
-
static void
ALF_Label_Paint(HWND hwnd, ALFLabelPriv *priv, HDC hdc, RECT *r)
{
@@ -138,29 +123,7 @@ ALF_Label_Paint(HWND hwnd, ALFLabelPriv *priv, HDC hdc, RECT *r)
}
if (!IsWindowEnabled(hwnd)) {
- if (!ALF_Compat_IsMinWindowsVersion(4, 0)) {
- // Win32s/NT 3.51 uses gray text, but a different gray than Win9x
- SetTextColor(hdc, GetSysColor(COLOR_BTNSHADOW));
-
- DrawText(hdc, text, -1, &rcTarget, format);
- } else if (ALF_Compat_IsWin9x()) {
- // Win9x just uses gray text. DSS_DISABLED is broken there, too,
- // so we can't get the NT look even if we wanted to
- SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
-
- DrawText(hdc, text, -1, &rcTarget, format);
- } else {
- // FIXME! This doesn't look good when using uxtheme, even though windows does it the same way
- // need to investigate whether drawing with disabled button style looks nicer
- DrawState(hdc, NULL,
- ALF__Label_Text_DrawStateProc,
- (LPARAM)text, (WPARAM)format,
- rcTarget.left,
- rcTarget.top,
- rcTarget.right - rcTarget.left,
- rcTarget.bottom - rcTarget.top,
- DST_COMPLEX | DSS_DISABLED);
- }
+ ALF_Compat_DrawDisabledText(hdc, text, -1, &rcTarget, format);
} else {
DrawText(hdc, text, -1, &rcTarget, format);
}