From b853de803877bd471b9a0397289be711c0fad1c8 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 20 Oct 2009 21:54:40 +0400 Subject: [PATCH] comctl32/syslink: Implement LWS_TRANSPARENT style. --- dlls/comctl32/syslink.c | 9 +++++++-- include/commctrl.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 1b940c0e457..a1a60391189 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -94,6 +94,7 @@ typedef struct COLORREF TextColor; /* Color of the text */ COLORREF LinkColor; /* Color of links */ COLORREF VisitedColor; /* Color of visited links */ + COLORREF BackColor; /* Background color, set on creation */ WCHAR BreakChar; /* Break Character for the current font */ } SYSLINK_INFO; @@ -831,7 +832,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc) hOldFont = SelectObject(hdc, infoPtr->Font); OldTextColor = SetTextColor(hdc, infoPtr->TextColor); - OldBkColor = SetBkColor(hdc, comctl32_color.clrBtnFace); + OldBkColor = SetBkColor(hdc, infoPtr->BackColor); GetClientRect(infoPtr->Self, &rc); rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN; @@ -916,7 +917,7 @@ static LRESULT SYSLINK_EraseBkgnd (const SYSLINK_INFO *infoPtr, HDC hdc) RECT r; GetClientRect(infoPtr->Self, &r); - hbr = CreateSolidBrush(comctl32_color.clrBtnFace); + hbr = CreateSolidBrush(infoPtr->BackColor); FillRect(hdc, &r, hbr); DeleteObject(hbr); @@ -1749,6 +1750,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, infoPtr->TextColor = comctl32_color.clrWindowText; infoPtr->LinkColor = comctl32_color.clrHighlight; infoPtr->VisitedColor = comctl32_color.clrHighlight; + infoPtr->BackColor = infoPtr->Style & LWS_TRANSPARENT ? + comctl32_color.clrWindow : comctl32_color.clrBtnFace; infoPtr->BreakChar = ' '; TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd); SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName); @@ -1765,6 +1768,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); + if (infoPtr->Style & LWS_TRANSPARENT) + infoPtr->BackColor = comctl32_color.clrWindow; return 0; default: diff --git a/include/commctrl.h b/include/commctrl.h index b8ebe94145b..ffda1f16c03 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -5052,6 +5052,9 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR); static const WCHAR WC_LINK[] = { 'S','y','s','L','i','n','k',0 }; #endif +/* SysLink styles */ +#define LWS_TRANSPARENT 0x0001 + /* SysLink messages */ #define LM_HITTEST (WM_USER + 768) #define LM_GETIDEALHEIGHT (WM_USER + 769)