Commit cf9e6b3b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard
Browse files

user32: Inline DEFWND_ControlColor implementation.

parent fa7aaca9
Pipeline #832 skipped
......@@ -106,9 +106,6 @@ struct tagWND;
extern ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN;
extern void register_desktop_class(void) DECLSPEC_HIDDEN;
/* defwnd proc */
extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
/* desktop */
extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
......
......@@ -34,42 +34,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(win);
/***********************************************************************
* DEFWND_ControlColor
*
* Default colors for control painting.
*/
HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
{
if( ctlType == CTLCOLOR_SCROLLBAR)
{
HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
COLORREF bk = GetSysColor(COLOR_3DHILIGHT);
SetTextColor( hDC, GetSysColor(COLOR_3DFACE));
SetBkColor( hDC, bk);
/* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
* we better use 0x55aa bitmap brush to make scrollbar's background
* look different from the window background.
*/
if (bk == GetSysColor(COLOR_WINDOW))
return SYSCOLOR_Get55AABrush();
UnrealizeObject( hb );
return hb;
}
SetTextColor( hDC, GetSysColor(COLOR_WINDOWTEXT));
if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
else {
SetBkColor( hDC, GetSysColor(COLOR_3DFACE) );
return GetSysColorBrush(COLOR_3DFACE);
}
return GetSysColorBrush(COLOR_WINDOW);
}
/***********************************************************************
* DefWindowProcA (USER32.@)
......
......@@ -97,18 +97,30 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
HPEN hSavePen;
HBRUSH hSaveBrush,hBrush;
/* Select the correct brush and pen */
/* Only scrollbar controls send WM_CTLCOLORSCROLLBAR.
* The window-owned scrollbars need to call DEFWND_ControlColor
* to correctly setup default scrollbar colors
*/
if (nBar == SB_CTL) {
if (nBar == SB_CTL)
{
hBrush = (HBRUSH)SendMessageW( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
(WPARAM)hdc,(LPARAM)hwnd);
} else {
hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR );
}
else
{
COLORREF bk = GetSysColor( COLOR_3DHILIGHT );
SetTextColor( hdc, GetSysColor( COLOR_3DFACE ));
SetBkColor( hdc, bk );
/* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
* we better use 0x55aa bitmap brush to make scrollbar's background
* look different from the window background.
*/
if (bk == GetSysColor( COLOR_WINDOW ))
hBrush = SYSCOLOR_Get55AABrush();
else
{
hBrush = GetSysColorBrush( COLOR_SCROLLBAR );
UnrealizeObject( hBrush );
}
}
hSavePen = SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
hSaveBrush = SelectObject( hdc, hBrush );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment