comctl32: Fix disabled thumb painting, for TBS_BOTH use edged rectangle.
This commit is contained in:
parent
0325dc6186
commit
2248cfbb6b
|
@ -613,17 +613,10 @@ TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc)
|
|||
}
|
||||
|
||||
static void
|
||||
TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc)
|
||||
TRACKBAR_DrawThumb (TRACKBAR_INFO *infoPtr, HDC hdc)
|
||||
{
|
||||
HBRUSH oldbr;
|
||||
HPEN oldpen;
|
||||
RECT thumb = infoPtr->rcThumb;
|
||||
int BlackUntil = 3;
|
||||
int PointCount = 6;
|
||||
POINT points[6];
|
||||
int fillClr;
|
||||
int PointDepth;
|
||||
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
|
||||
HBRUSH brush;
|
||||
|
||||
if (theme)
|
||||
{
|
||||
|
@ -645,32 +638,42 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc)
|
|||
else
|
||||
stateId = TUS_NORMAL;
|
||||
|
||||
DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0);
|
||||
DrawThemeBackground (theme, hdc, partId, stateId, &infoPtr->rcThumb, NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fillClr = infoPtr->flags & TB_DRAG_MODE ? COLOR_BTNHILIGHT : COLOR_BTNFACE;
|
||||
oldbr = SelectObject (hdc, GetSysColorBrush(fillClr));
|
||||
SetPolyFillMode (hdc, WINDING);
|
||||
if (infoPtr->dwStyle & WS_DISABLED)
|
||||
{
|
||||
if (comctl32_color.clr3dHilight == comctl32_color.clrWindow)
|
||||
brush = COMCTL32_hPattern55AABrush;
|
||||
else
|
||||
brush = GetSysColorBrush(COLOR_SCROLLBAR);
|
||||
|
||||
SetTextColor(hdc, comctl32_color.clr3dFace);
|
||||
SetBkColor(hdc, comctl32_color.clr3dHilight);
|
||||
}
|
||||
else
|
||||
brush = GetSysColorBrush(infoPtr->flags & TB_DRAG_MODE ? COLOR_BTNHILIGHT : COLOR_BTNFACE);
|
||||
|
||||
if (infoPtr->dwStyle & TBS_BOTH)
|
||||
{
|
||||
points[0].x=thumb.right;
|
||||
points[0].y=thumb.top;
|
||||
points[1].x=thumb.right;
|
||||
points[1].y=thumb.bottom;
|
||||
points[2].x=thumb.left;
|
||||
points[2].y=thumb.bottom;
|
||||
points[3].x=thumb.left;
|
||||
points[3].y=thumb.top;
|
||||
points[4].x=points[0].x;
|
||||
points[4].y=points[0].y;
|
||||
PointCount = 5;
|
||||
BlackUntil = 3;
|
||||
FillRect(hdc, &infoPtr->rcThumb, brush);
|
||||
DrawEdge(hdc, &infoPtr->rcThumb, EDGE_RAISED, BF_RECT | BF_SOFT);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
HBRUSH oldbr = SelectObject(hdc, brush);
|
||||
RECT thumb = infoPtr->rcThumb;
|
||||
int BlackUntil = 3;
|
||||
int PointCount = 6;
|
||||
POINT points[6];
|
||||
int PointDepth;
|
||||
HPEN oldpen;
|
||||
|
||||
SetPolyFillMode (hdc, WINDING);
|
||||
|
||||
if (infoPtr->dwStyle & TBS_VERT)
|
||||
{
|
||||
PointDepth = (thumb.bottom - thumb.top) / 2;
|
||||
|
@ -742,8 +745,6 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc)
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Draw the thumb now */
|
||||
Polygon (hdc, points, PointCount);
|
||||
oldpen = SelectObject(hdc, GetStockObject(BLACK_PEN));
|
||||
|
@ -752,6 +753,7 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc)
|
|||
Polyline(hdc, &points[BlackUntil-1], PointCount+1-BlackUntil);
|
||||
SelectObject(hdc, oldpen);
|
||||
SelectObject(hdc, oldbr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue