private void DrawToolStripSeparator(Graphics g,
bool vertical,
Rectangle rect,
Color lightColor,
Color darkColor,
int horizontalInset,
bool rtl)
{
RectangleF boundsF = new RectangleF(rect.X, rect.Y, rect.Width, rect.Height);
if (vertical)
{
int l = rect.Width / 2;
int t = rect.Y;
// Draw vertical lines centered
using (LinearGradientBrush lightBrush = new LinearGradientBrush(boundsF, Color.Transparent, lightColor, 90),
darkBrush = new LinearGradientBrush(boundsF, Color.Transparent, darkColor, 90))
{
lightBrush.Blend = _separatorLightBlend;
darkBrush.Blend = _separatorDarkBlend;
g.FillRectangle(lightBrush, l - 1, t, 3, rect.Height);
g.FillRectangle(darkBrush, l, t, 1, rect.Height);
}
}
else
{
int l = rect.X;
int t = rect.Height / 2;
// Draw horizontal lines centered
using (LinearGradientBrush lightBrush = new LinearGradientBrush(boundsF, Color.Transparent, lightColor, 0f),
darkBrush = new LinearGradientBrush(boundsF, Color.Transparent, darkColor, 0f))
{
lightBrush.Blend = _separatorLightBlend;
darkBrush.Blend = _separatorDarkBlend;
g.FillRectangle(lightBrush, l, t - 1, rect.Width, 3);
g.FillRectangle(darkBrush, l, t, rect.Width, 1);
}
}
}