Author: tkreuzer
Date: Sat Apr 12 16:37:04 2008
New Revision: 32934
URL:
http://svn.reactos.org/svn/reactos?rev=32934&view=rev
Log:
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.
Modified:
trunk/reactos/dll/win32/user32/controls/button.c
Modified: trunk/reactos/dll/win32/user32/controls/button.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] Sat Apr 12 16:37:04
2008
@@ -826,8 +826,22 @@
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 );
}