Skip to content

Commit

Permalink
fix ListView column border in dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayXHD committed Feb 22, 2021
1 parent f9bf40c commit 221fc39
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions GitUI/Theming/Renderers/ListViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,29 @@ internal class ListViewRenderer : ThemeRenderer
case Parts.LVP_LISTITEM:
return RenderItemBackground(ctx, (State.ListItem)stateid, prect);

case Parts.LVP_COLUMNDETAIL:
return RenderColumnDetail(ctx, prect);

default:
return Unhandled;
}
}

private int RenderColumnDetail(Context ctx, Rectangle prect)
{
int width = Math.Max(1, prect.Width / 2);
using var brush = new SolidBrush(Color.FromArgb(32, SystemColors.HotTrack));
ctx.Graphics.FillRectangle(
brush,
Rectangle.FromLTRB(
prect.Right - width,
prect.Top,
prect.Right,
prect.Bottom));

return Handled;
}

public override int RenderBackgroundEx(
IntPtr htheme, IntPtr hdc,
int partid, int stateid,
Expand Down

0 comments on commit 221fc39

Please sign in to comment.