https://git.reactos.org/?p=reactos.git;a=commitdiff;h=695147eaacf99d47e771b…
commit 695147eaacf99d47e771b063cd896b5379488ca8
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Thu Jan 4 23:25:37 2018 +0200
[COMCTL32] tab: Use DrawThemeText when drawing text with themes. CORE-13855
---
dll/win32/comctl32/tab.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/dll/win32/comctl32/tab.c b/dll/win32/comctl32/tab.c
index 0a191c04c7..c5e3a8672f 100644
--- a/dll/win32/comctl32/tab.c
+++ b/dll/win32/comctl32/tab.c
@@ -1534,6 +1534,9 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem,
RECT *drawRect
HPEN holdPen;
INT oldBkMode;
HFONT hOldFont;
+#ifdef __REACTOS__
+HTHEME theme = GetWindowTheme (infoPtr->hwnd);
+#endif
/* if (drawRect == NULL) */
{
@@ -1904,6 +1907,29 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem,
RECT *drawRect
TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%s), textlen=%d\n",
debugstr_w(item->pszText), center_offset_h, center_offset_v,
wine_dbgstr_rect(drawRect), (rcText.right-rcText.left));
+#ifdef __REACTOS__
+ if (theme && item->pszText)
+ {
+ int partIndex = iItem == infoPtr->iSelected ? TABP_TABITEM :
TABP_TOPTABITEM;
+ int stateId = TIS_NORMAL;
+
+ if (iItem == infoPtr->iSelected)
+ stateId = TIS_SELECTED;
+ else if (iItem == infoPtr->iHotTracked)
+ stateId = TIS_HOT;
+ else if (iItem == infoPtr->uFocus)
+ stateId = TIS_FOCUSED;
+
+ DrawThemeText(theme,
+ hdc,
+ partIndex,
+ stateId,
+ item->pszText,
+ lstrlenW(item->pszText),
+ DT_LEFT | DT_SINGLELINE, 0, drawRect);
+ }
+ else
+#endif
if (item->pszText)
{
DrawTextW