(CCing wine-devel again)
Dimi Paun wrote:
Problem is that DrawText() for the subitems will also use the background color - which is wrong.
Why is it wrong?
Because the "background color" isn't the background color of the list. And it's definitly not the text bkclr in gdi-context either - I hacked together an app to prove that:
http://flexo.popuserv.org/test.c
Now it seems getting rid of the OPAQUE completly is wrong, but for different reasons.
It seems to me that this is a bit of a problem:
3783 if (nSubItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW)) 3784 prepaint_setup(infoPtr, hdc, &nmlvcd); 3785 3786 /* in full row select, subitems, will just use main item's colors */ 3787 if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) 3788 nmlvcd.clrTextBk = CLR_NONE;
I guess the call to prepaint_setup should come _after_ the if with FULLROWSELECT, no?
Depends. Right now this code does nothing (and I was going to remove it anyway) - the only place where clrTextBk is read from is in prepaint_setup() - but prepaint_setup() is not called for subitems (and the CLR_NONE override is only done for subitems).
Also, I can't remember, but there was a reason why prepain_setup was called just for the main item, why did you changed that?
Because subitems can use different colors (see test app) and prepaint_setup() is where the colors are set up...
Note that I don't change the notifications being passed or anything of their context (with the exception of the GDI context in the postpaint notification - but the GDI context should be saved & restored in between anyway, see the failing test I commited a few days ago) so I can't imagine how this could break anything.
Felix
On Fri, March 16, 2007 16:37, Felix Nawothnig wrote:
It seems to me that this is a bit of a problem:
3783 if (nSubItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW)) 3784 prepaint_setup(infoPtr, hdc, &nmlvcd); 3785 3786 /* in full row select, subitems, will just use main item's colors */ 3787 if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) 3788 nmlvcd.clrTextBk = CLR_NONE;
I guess the call to prepaint_setup should come _after_ the if with FULLROWSELECT, no?
Depends. Right now this code does nothing (and I was going to remove it anyway) - the only place where clrTextBk is read from is in prepaint_setup() - but prepaint_setup() is not called for subitems (and the CLR_NONE override is only done for subitems).
Well, but that's the point: now that prepaint_setup() is always called (I agree with that change), this would do what we want if only we said the CLR_NONE _before_ the call to prepaint_setup() where it's being acted on.
Wouldn't that solve the problem?
Dimi Paun wrote:
Depends. Right now this code does nothing (and I was going to remove it anyway) - the only place where clrTextBk is read from is in prepaint_setup() - but prepaint_setup() is not called for subitems (and the CLR_NONE override is only done for subitems).
Well, but that's the point: now that prepaint_setup() is always called (I agree with that change), this would do what we want if only we said the CLR_NONE _before_ the call to prepaint_setup() where it's being acted on.
Doesn't work because prepaint_setup() overrides the color again. Anyway, I'm revising my patches...
Felix