From 1533c2379d867dfc1ef86ac2485c7f951a02036c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 12 Apr 2008 21:37:04 +0000 Subject: [PATCH] When drawing disabled buttons, use DrawText 2 times instead of using DrawState, which creates a mono bitmap first and that looks ugly with freetype. This makes the disabled buttons look as nice as the disabled menus. svn path=/trunk/; revision=32934 --- reactos/dll/win32/user32/controls/button.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/user32/controls/button.c b/reactos/dll/win32/user32/controls/button.c index 09f0ba73158..0bfd70ad0d9 100644 --- a/reactos/dll/win32/user32/controls/button.c +++ b/reactos/dll/win32/user32/controls/button.c @@ -826,8 +826,22 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) return; } - DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rc->left, rc->top, - rc->right - rc->left, rc->bottom - rc->top, flags); + /* ROS Hack to make font look less ugly */ + if ( ((style & (BS_ICON|BS_BITMAP)) == BS_TEXT) && + (flags & DSS_DISABLED) ) + { + ++rc->left; ++rc->top; ++rc->right; ++rc->bottom; + SetTextColor(hdc, GetSysColor(COLOR_3DHILIGHT)); + DrawTextW(hdc, (LPCWSTR)lp, -1, rc, (UINT)wp); + --rc->left; --rc->top; --rc->right; --rc->bottom; + SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT)); + DrawTextW(hdc, (LPCWSTR)lp, -1, rc, (UINT)wp); + } + else + { + DrawStateW(hdc, hbr, lpOutputProc, lp, wp, rc->left, rc->top, + rc->right - rc->left, rc->bottom - rc->top, flags); + } HeapFree( GetProcessHeap(), 0, text ); }