Commit 5bded560 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Fix colours used for SS_*RECT, SS_*FRAME.

parent 20322840
...@@ -67,7 +67,7 @@ static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ); ...@@ -67,7 +67,7 @@ static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style );
static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
static COLORREF color_windowframe, color_background, color_window; static COLORREF color_3dshadow, color_3ddkshadow, color_3dhighlight;
/* offsets for GetWindowLong for static private information */ /* offsets for GetWindowLong for static private information */
#define HFONT_GWL_OFFSET 0 #define HFONT_GWL_OFFSET 0
...@@ -239,6 +239,13 @@ static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style) ...@@ -239,6 +239,13 @@ static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
} }
} }
static VOID STATIC_InitColours()
{
color_3ddkshadow = GetSysColor(COLOR_3DDKSHADOW);
color_3dshadow = GetSysColor(COLOR_3DSHADOW);
color_3dhighlight = GetSysColor(COLOR_3DHIGHLIGHT);
}
/*********************************************************************** /***********************************************************************
* StaticWndProc_common * StaticWndProc_common
*/ */
...@@ -257,10 +264,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -257,10 +264,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
ERR("Unknown style 0x%02lx\n", style ); ERR("Unknown style 0x%02lx\n", style );
return -1; return -1;
} }
/* initialise colours */ STATIC_InitColours();
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_background = GetSysColor(COLOR_BACKGROUND);
color_window = GetSysColor(COLOR_WINDOW);
break; break;
case WM_NCDESTROY: case WM_NCDESTROY:
...@@ -293,9 +297,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -293,9 +297,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
break; break;
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
color_windowframe = GetSysColor(COLOR_WINDOWFRAME); STATIC_InitColours();
color_background = GetSysColor(COLOR_BACKGROUND);
color_window = GetSysColor(COLOR_WINDOW);
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
break; break;
...@@ -543,27 +545,27 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style ) ...@@ -543,27 +545,27 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style )
switch (style & SS_TYPEMASK) switch (style & SS_TYPEMASK)
{ {
case SS_BLACKRECT: case SS_BLACKRECT:
hBrush = CreateSolidBrush(color_windowframe); hBrush = CreateSolidBrush(color_3ddkshadow);
FillRect( hdc, &rc, hBrush ); FillRect( hdc, &rc, hBrush );
break; break;
case SS_GRAYRECT: case SS_GRAYRECT:
hBrush = CreateSolidBrush(color_background); hBrush = CreateSolidBrush(color_3dshadow);
FillRect( hdc, &rc, hBrush ); FillRect( hdc, &rc, hBrush );
break; break;
case SS_WHITERECT: case SS_WHITERECT:
hBrush = CreateSolidBrush(color_window); hBrush = CreateSolidBrush(color_3dhighlight);
FillRect( hdc, &rc, hBrush ); FillRect( hdc, &rc, hBrush );
break; break;
case SS_BLACKFRAME: case SS_BLACKFRAME:
hBrush = CreateSolidBrush(color_windowframe); hBrush = CreateSolidBrush(color_3ddkshadow);
FrameRect( hdc, &rc, hBrush ); FrameRect( hdc, &rc, hBrush );
break; break;
case SS_GRAYFRAME: case SS_GRAYFRAME:
hBrush = CreateSolidBrush(color_background); hBrush = CreateSolidBrush(color_3dshadow);
FrameRect( hdc, &rc, hBrush ); FrameRect( hdc, &rc, hBrush );
break; break;
case SS_WHITEFRAME: case SS_WHITEFRAME:
hBrush = CreateSolidBrush(color_window); hBrush = CreateSolidBrush(color_3dhighlight);
FrameRect( hdc, &rc, hBrush ); FrameRect( hdc, &rc, hBrush );
break; break;
default: default:
......
Markdown is supported
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