Skip to content
Open
Show file tree
Hide file tree
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 @@ -274,7 +274,14 @@ private void OnListDrawItem(object? sender, DrawItemEventArgs die)

_editor.PaintValue(value, graphics, new Rectangle(die.Bounds.X + 2, die.Bounds.Y + 2, 22, die.Bounds.Height - 4));
graphics.DrawRectangle(SystemPens.WindowText, new Rectangle(die.Bounds.X + 2, die.Bounds.Y + 2, 22 - 1, die.Bounds.Height - 4 - 1));
Brush foreBrush = new SolidBrush(die.ForeColor);

Color textColor = die.ForeColor;
if (Application.IsDarkModeEnabled && die.State.HasFlag(DrawItemState.Selected))
{
textColor = SystemColors.ControlText;
}

Brush foreBrush = new SolidBrush(textColor);
graphics.DrawString(value.Name, font, foreBrush, die.Bounds.X + 26, die.Bounds.Y);
foreBrush.Dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ protected override void OnDrawItem(DrawItemEventArgs e)
Cursor cursor = (Cursor)Items[e.Index];
string? text = _cursorConverter.ConvertToString(cursor);
Font font = e.Font!;
using var brushText = e.ForeColor.GetCachedSolidBrushScope();

Color textColor = e.ForeColor;
if (Application.IsDarkModeEnabled && e.State.HasFlag(DrawItemState.Selected))
{
textColor = SystemColors.ControlText;
}

using var brushText = textColor.GetCachedSolidBrushScope();
var cursorWidth = ScaleHelper.ScaleSmallIconToDpi(Icon.FromHandle(cursor.Handle), DeviceDpi).Size.Width;

e.DrawBackground();
Expand Down