Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,13 @@ private unsafe void CustomDraw(ref Message m)

_odCacheFontHandleWrapper = new FontHandleWrapper(subItemFont);
PInvokeCore.SelectObject(nmcd->nmcd.hdc, _odCacheFontHandleWrapper.Handle);
// ListView is the underlying control—so when it's in DarkMode and Enable=false,
// we need to change the font to a darker color so that the content in the ListView can be displayed correctly.
if (Application.IsDarkModeEnabled && !Enabled && DarkModeRequestState is true)
{
nmcd->clrText = (COLORREF)ColorTranslator.ToWin32(SystemColors.ControlDarkDark);
nmcd->clrTextBk = (COLORREF)ColorTranslator.ToWin32(Color.FromArgb(255, 240, 240, 240));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to set the text background separately?

Just a suggestion: Using InactiveCaptionText can make the disabled state more noticeable.

}
}

if (!lockReturnValue)
Expand Down
Loading