comctl32: Correctly report systemcolor use for Treeview background.
This commit is contained in:
parent
114da7c46b
commit
f35960200a
|
@ -427,11 +427,9 @@ static void TestGetSetBkColor(void)
|
||||||
{
|
{
|
||||||
COLORREF crColor = RGB(0,0,0);
|
COLORREF crColor = RGB(0,0,0);
|
||||||
|
|
||||||
todo_wine{
|
/* If the value is -1, the control is using the system color for the background color. */
|
||||||
/* If the value is -1, the control is using the system color for the background color. */
|
crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
|
||||||
crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
|
ok(crColor == -1, "Default background color reported as 0x%.8x\n", crColor);
|
||||||
ok(crColor == -1, "Default background color reported as 0x%.8x\n", crColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Test for black background */
|
/* Test for black background */
|
||||||
SendMessage( hTree, TVM_SETBKCOLOR, 0, (LPARAM)RGB(0,0,0) );
|
SendMessage( hTree, TVM_SETBKCOLOR, 0, (LPARAM)RGB(0,0,0) );
|
||||||
|
|
|
@ -2306,11 +2306,13 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
|
||||||
& (TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS))
|
& (TVS_LINESATROOT|TVS_HASLINES|TVS_HASBUTTONS))
|
||||||
> TVS_LINESATROOT);
|
> TVS_LINESATROOT);
|
||||||
HBRUSH hbr, hbrOld;
|
HBRUSH hbr, hbrOld;
|
||||||
|
COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
|
||||||
|
infoPtr->clrBk;
|
||||||
|
|
||||||
if (!lar && item->iLevel == 0)
|
if (!lar && item->iLevel == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hbr = CreateSolidBrush(infoPtr->clrBk);
|
hbr = CreateSolidBrush(clrBk);
|
||||||
hbrOld = SelectObject(hdc, hbr);
|
hbrOld = SelectObject(hdc, hbr);
|
||||||
|
|
||||||
centerx = (item->linesOffset + item->stateOffset) / 2;
|
centerx = (item->linesOffset + item->stateOffset) / 2;
|
||||||
|
@ -2423,8 +2425,8 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE
|
||||||
{
|
{
|
||||||
Rectangle(hdc, centerx - 1, centery - plussize + 1,
|
Rectangle(hdc, centerx - 1, centery - plussize + 1,
|
||||||
centerx + 2, centery + plussize);
|
centerx + 2, centery + plussize);
|
||||||
SetPixel(hdc, centerx - 1, centery, infoPtr->clrBk);
|
SetPixel(hdc, centerx - 1, centery, clrBk);
|
||||||
SetPixel(hdc, centerx + 1, centery, infoPtr->clrBk);
|
SetPixel(hdc, centerx + 1, centery, clrBk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2472,7 +2474,8 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nmcdhdr.clrTextBk = infoPtr->clrBk;
|
nmcdhdr.clrTextBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
|
||||||
|
infoPtr->clrBk;
|
||||||
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem))
|
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem))
|
||||||
nmcdhdr.clrText = comctl32_color.clrHighlight;
|
nmcdhdr.clrText = comctl32_color.clrHighlight;
|
||||||
else if (infoPtr->clrText == -1)
|
else if (infoPtr->clrText == -1)
|
||||||
|
@ -2782,9 +2785,12 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC)
|
TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC)
|
||||||
{
|
{
|
||||||
HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk);
|
HBRUSH hBrush;
|
||||||
|
COLORREF clrBk = infoPtr->clrBk == -1 ? GetSysColor(COLOR_WINDOW):
|
||||||
|
infoPtr->clrBk;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
|
||||||
|
hBrush = CreateSolidBrush(clrBk);
|
||||||
GetClientRect(infoPtr->hwnd, &rect);
|
GetClientRect(infoPtr->hwnd, &rect);
|
||||||
FillRect(hDC, &rect, hBrush);
|
FillRect(hDC, &rect, hBrush);
|
||||||
DeleteObject(hBrush);
|
DeleteObject(hBrush);
|
||||||
|
@ -4937,7 +4943,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
|
|
||||||
infoPtr->scrollX = 0;
|
infoPtr->scrollX = 0;
|
||||||
|
|
||||||
infoPtr->clrBk = GetSysColor(COLOR_WINDOW);
|
infoPtr->clrBk = -1; /* use system color */
|
||||||
infoPtr->clrText = -1; /* use system color */
|
infoPtr->clrText = -1; /* use system color */
|
||||||
infoPtr->clrLine = RGB(128, 128, 128);
|
infoPtr->clrLine = RGB(128, 128, 128);
|
||||||
infoPtr->clrInsertMark = GetSysColor(COLOR_BTNTEXT);
|
infoPtr->clrInsertMark = GetSysColor(COLOR_BTNTEXT);
|
||||||
|
|
Loading…
Reference in New Issue