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
This commit is contained in:
Timo Kreuzer 2008-04-12 21:37:04 +00:00
parent c7ae31aabf
commit 1533c2379d

View file

@ -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 );
}