Module: wine Branch: master Commit: cf67786e406c3a5a7be913bd1c31b0903e6ba29f URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf67786e406c3a5a7be913bd1c...
Author: Nikolay Sivov bunglehead@gmail.com Date: Mon May 18 19:03:40 2009 +0400
comctl32/monthcal: Use cached colors instead of GetSysColor for MonthCal.
---
dlls/comctl32/monthcal.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 15acf1f..be41451 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -456,7 +456,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT SYSTEMTIME localtime; int startofprescal;
- oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT)); + oldTextColor = SetTextColor(hdc, comctl32_color.clrWindowText);
/* fill background */ hbr = CreateSolidBrush (infoPtr->bk); @@ -1926,12 +1926,12 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam) infoPtr->monthRange = 3; infoPtr->monthdayState = Alloc (infoPtr->monthRange * sizeof(MONTHDAYSTATE)); - infoPtr->titlebk = GetSysColor(COLOR_ACTIVECAPTION); - infoPtr->titletxt = GetSysColor(COLOR_WINDOW); - infoPtr->monthbk = GetSysColor(COLOR_WINDOW); - infoPtr->trailingtxt = GetSysColor(COLOR_GRAYTEXT); - infoPtr->bk = GetSysColor(COLOR_WINDOW); - infoPtr->txt = GetSysColor(COLOR_WINDOWTEXT); + infoPtr->titlebk = comctl32_color.clrActiveCaption; + infoPtr->titletxt = comctl32_color.clrWindow; + infoPtr->monthbk = comctl32_color.clrWindow; + infoPtr->trailingtxt = comctl32_color.clrGrayText; + infoPtr->bk = comctl32_color.clrWindow; + infoPtr->txt = comctl32_color.clrWindowText;
/* set the current day for highlighing */ infoPtr->minSel.wDay = infoPtr->todaysDate.wDay; @@ -2082,6 +2082,10 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: return MONTHCAL_Destroy(infoPtr);
+ case WM_SYSCOLORCHANGE: + COMCTL32_RefreshSysColors(); + return 0; + default: if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg)) ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);