Commit ee3ec759 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/status: Do not draw background for status text.

DrawStatusTextW() always draws the text background, so it's unfit to use it directly to draw status text because status control draws its own background. Fix status control text having wrong background when themed. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1cdea98b
......@@ -182,6 +182,7 @@ extern COMCTL32_SysColor comctl32_color DECLSPEC_HIDDEN;
/* Internal function */
HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
void COMCTL32_DrawStatusText(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style, BOOL draw_background) DECLSPEC_HIDDEN;
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal) DECLSPEC_HIDDEN;
void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground) DECLSPEC_HIDDEN;
......
......@@ -460,39 +460,25 @@ GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, const INT *lpInfo)
} while (*lpRun);
}
/***********************************************************************
* DrawStatusTextW [COMCTL32.@]
*
* Draws text with borders, like in a status bar.
*
* PARAMS
* hdc [I] handle to the window's display context
* lprc [I] pointer to a rectangle
* text [I] pointer to the text
* style [I] drawing style
*
* RETURNS
* No return value.
*
* NOTES
* The style variable can have one of the following values:
* (will be written ...)
*/
void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
void COMCTL32_DrawStatusText(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style, BOOL draw_background)
{
RECT r = *lprc;
UINT border = BDR_SUNKENOUTER;
UINT border;
COLORREF oldbkcolor;
if (style & SBT_POPOUT)
border = BDR_RAISEDOUTER;
else if (style & SBT_NOBORDERS)
border = 0;
if (draw_background)
{
if (style & SBT_POPOUT)
border = BDR_RAISEDOUTER;
else if (style & SBT_NOBORDERS)
border = 0;
else
border = BDR_SUNKENOUTER;
oldbkcolor = SetBkColor (hdc, comctl32_color.clrBtnFace);
DrawEdge (hdc, &r, border, BF_MIDDLE|BF_RECT|BF_ADJUST);
oldbkcolor = SetBkColor (hdc, comctl32_color.clrBtnFace);
DrawEdge (hdc, &r, border, BF_MIDDLE|BF_RECT|BF_ADJUST);
SetBkColor (hdc, oldbkcolor);
}
/* now draw text */
if (text) {
......@@ -524,10 +510,31 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
SetBkMode (hdc, oldbkmode);
SetTextColor (hdc, oldtextcolor);
}
SetBkColor (hdc, oldbkcolor);
}
/***********************************************************************
* DrawStatusTextW [COMCTL32.@]
*
* Draws text with borders, like in a status bar.
*
* PARAMS
* hdc [I] handle to the window's display context
* lprc [I] pointer to a rectangle
* text [I] pointer to the text
* style [I] drawing style
*
* RETURNS
* No return value.
*
* NOTES
* The style variable can have one of the following values:
* (will be written ...)
*/
void WINAPI DrawStatusTextW(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
{
COMCTL32_DrawStatusText(hdc, lprc, text, style, TRUE);
}
/***********************************************************************
* DrawStatusText [COMCTL32.@]
......
......@@ -139,7 +139,6 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
DrawFrameControl( hdc, &rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP );
}
static void
STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
{
......@@ -187,7 +186,7 @@ STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART
SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
} else {
r.left += x;
DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
COMCTL32_DrawStatusText(hdc, &r, part->text, 0, FALSE);
}
}
......
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