Commit 7b995929 authored by Felix Nawothnig's avatar Felix Nawothnig Committed by Alexandre Julliard

comctl32: Fix my last patch.

My last patch was wrong and caused some nasty regressions. Mapping CLR_DEFAULT to the global defaults seem to be what native does.
parent eba06046
...@@ -946,6 +946,11 @@ static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage ...@@ -946,6 +946,11 @@ static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage
static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd) static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd)
{ {
if (lpnmlvcd->clrTextBk == CLR_DEFAULT)
lpnmlvcd->clrTextBk = comctl32_color.clrWindow;
if (lpnmlvcd->clrText == CLR_DEFAULT)
lpnmlvcd->clrText = comctl32_color.clrWindowText;
/* apprently, for selected items, we have to override the returned values */ /* apprently, for selected items, we have to override the returned values */
if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED) if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
{ {
...@@ -965,8 +970,7 @@ static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpn ...@@ -965,8 +970,7 @@ static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpn
if (lpnmlvcd->clrTextBk != CLR_NONE) if (lpnmlvcd->clrTextBk != CLR_NONE)
{ {
SetBkMode(hdc, OPAQUE); SetBkMode(hdc, OPAQUE);
if (lpnmlvcd->clrTextBk != CLR_DEFAULT) SetBkColor(hdc,lpnmlvcd->clrTextBk);
SetBkColor(hdc,lpnmlvcd->clrTextBk);
} }
else else
SetBkMode(hdc, TRANSPARENT); SetBkMode(hdc, TRANSPARENT);
...@@ -7717,7 +7721,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -7717,7 +7721,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
/* initialize color information */ /* initialize color information */
infoPtr->clrBk = CLR_NONE; infoPtr->clrBk = CLR_NONE;
infoPtr->clrText = comctl32_color.clrWindowText; infoPtr->clrText = CLR_DEFAULT;
infoPtr->clrTextBk = CLR_DEFAULT; infoPtr->clrTextBk = CLR_DEFAULT;
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
......
...@@ -624,11 +624,11 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) ...@@ -624,11 +624,11 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
return CDRF_NOTIFYSUBITEMDRAW; return CDRF_NOTIFYSUBITEMDRAW;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM: case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc); clr = GetBkColor(nmlvcd->nmcd.hdc);
ok(clr == c0ffee, "clr=%.8x\n", clr); todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
return CDRF_NOTIFYPOSTPAINT; return CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc); clr = GetBkColor(nmlvcd->nmcd.hdc);
ok(clr == c0ffee, "clr=%.8x\n", clr); todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
return CDRF_DODEFAULT; return CDRF_DODEFAULT;
} }
return CDRF_DODEFAULT; return CDRF_DODEFAULT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment