comctl32/tab: Fix highlighted tabs painting.
This commit is contained in:
parent
4b2ea6f4e2
commit
4ebf2e4526
|
@ -1496,6 +1496,18 @@ TAB_EraseTabInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
|
||||||
FillRect(hdc, &rTemp, hbr);
|
FillRect(hdc, &rTemp, hbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* highlighting is drawn on top of previous fills */
|
||||||
|
if (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)
|
||||||
|
{
|
||||||
|
if (deleteBrush)
|
||||||
|
{
|
||||||
|
DeleteObject(hbr);
|
||||||
|
deleteBrush = FALSE;
|
||||||
|
}
|
||||||
|
hbr = GetSysColorBrush(COLOR_HIGHLIGHT);
|
||||||
|
FillRect(hdc, &rTemp, hbr);
|
||||||
|
}
|
||||||
|
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
if (deleteBrush) DeleteObject(hbr);
|
if (deleteBrush) DeleteObject(hbr);
|
||||||
}
|
}
|
||||||
|
@ -1649,10 +1661,15 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect
|
||||||
*/
|
*/
|
||||||
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
||||||
if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS))
|
if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS))
|
||||||
SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked)
|
{
|
||||||
&& !(lStyle & TCS_FLATBUTTONS))
|
if ((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked) &&
|
||||||
| (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ?
|
!(lStyle & TCS_FLATBUTTONS))
|
||||||
comctl32_color.clrHighlight : comctl32_color.clrBtnText);
|
SetTextColor(hdc, comctl32_color.clrHighlight);
|
||||||
|
else if (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)
|
||||||
|
SetTextColor(hdc, comctl32_color.clrHighlightText);
|
||||||
|
else
|
||||||
|
SetTextColor(hdc, comctl32_color.clrBtnText);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if owner draw, tell the owner to draw
|
* if owner draw, tell the owner to draw
|
||||||
|
@ -2698,6 +2715,8 @@ static inline LRESULT
|
||||||
TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
|
TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
|
||||||
{
|
{
|
||||||
LPDWORD lpState;
|
LPDWORD lpState;
|
||||||
|
DWORD oldState;
|
||||||
|
RECT r;
|
||||||
|
|
||||||
TRACE("(%p,%d,%s)\n", infoPtr, iItem, fHighlight ? "true" : "false");
|
TRACE("(%p,%d,%s)\n", infoPtr, iItem, fHighlight ? "true" : "false");
|
||||||
|
|
||||||
|
@ -2705,12 +2724,16 @@ TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lpState = &TAB_GetItem(infoPtr, iItem)->dwState;
|
lpState = &TAB_GetItem(infoPtr, iItem)->dwState;
|
||||||
|
oldState = *lpState;
|
||||||
|
|
||||||
if (fHighlight)
|
if (fHighlight)
|
||||||
*lpState |= TCIS_HIGHLIGHTED;
|
*lpState |= TCIS_HIGHLIGHTED;
|
||||||
else
|
else
|
||||||
*lpState &= ~TCIS_HIGHLIGHTED;
|
*lpState &= ~TCIS_HIGHLIGHTED;
|
||||||
|
|
||||||
|
if ((oldState != *lpState) && TAB_InternalGetItemRect (infoPtr, iItem, &r, NULL))
|
||||||
|
InvalidateRect (infoPtr->hwnd, &r, TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue