mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[COMCTL32] tab: Use DrawThemeText when drawing text with themes. CORE-13855
This commit is contained in:
parent
82f44a2107
commit
695147eaac
1 changed files with 26 additions and 0 deletions
|
@ -1534,6 +1534,9 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
|
||||||
HPEN holdPen;
|
HPEN holdPen;
|
||||||
INT oldBkMode;
|
INT oldBkMode;
|
||||||
HFONT hOldFont;
|
HFONT hOldFont;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if (drawRect == NULL) */
|
/* 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",
|
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,
|
debugstr_w(item->pszText), center_offset_h, center_offset_v,
|
||||||
wine_dbgstr_rect(drawRect), (rcText.right-rcText.left));
|
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)
|
if (item->pszText)
|
||||||
{
|
{
|
||||||
DrawTextW
|
DrawTextW
|
||||||
|
|
Loading…
Reference in a new issue