From a6f1faa394b4d40750b8bf8abc254fbedfa7a573 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Fri, 5 May 2017 10:55:12 +0000 Subject: [PATCH] [COMCTL32] Toolbar: Use DrawThemeText when themes are enabled. CORE-12789 svn path=/trunk/; revision=74480 --- reactos/dll/win32/comctl32/toolbar.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 3b1ed5f8acc..62ac44e5f0d 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -617,6 +617,9 @@ TOOLBAR_DrawString (const TOOLBAR_INFO *infoPtr, RECT *rcText, LPCWSTR lpText, COLORREF clrOldBk = 0; int oldBkMode = 0; UINT state = tbcd->nmcd.uItemState; +#ifdef __REACTOS__ + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); +#endif /* draw text */ if (lpText && infoPtr->nMaxTextRows > 0) { @@ -646,6 +649,25 @@ TOOLBAR_DrawString (const TOOLBAR_INFO *infoPtr, RECT *rcText, LPCWSTR lpText, clrOld = SetTextColor (hdc, tbcd->clrText); } +#ifdef __REACTOS__ + if (theme) + { + int partId = TP_BUTTON; + int stateId = TS_NORMAL; + + if (state & CDIS_DISABLED) + stateId = TS_DISABLED; + else if (state & CDIS_SELECTED) + stateId = TS_PRESSED; + else if (state & CDIS_CHECKED) + stateId = (state & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT; + else if (state & CDIS_HOT) + stateId = TS_HOT; + + DrawThemeText(theme, hdc, partId, stateId, lpText, -1, infoPtr->dwDTFlags, 0, rcText); + } + else +#endif DrawTextW (hdc, lpText, -1, rcText, infoPtr->dwDTFlags); SetTextColor (hdc, clrOld); if ((state & CDIS_MARKED) && !(dwItemCDFlag & TBCDRF_NOMARK))