void DrawCurveTabs(Cairo.Context cr, Cairo.Rectangle rectangle)
{
if (IsSeparator)
{
return;
}
cr.MoveTo(rectangle.X, rectangle.Y);
double bottom = rectangle.Y + rectangle.Height - 1;
cr.CurveTo(
rectangle.X + SpacerWidth / 2, rectangle.Y,
rectangle.X + SpacerWidth / 2, bottom,
rectangle.X + SpacerWidth, bottom);
cr.LineTo(rectangle.X + rectangle.Width - SpacerWidth, bottom);
cr.CurveTo(
rectangle.X + rectangle.Width - SpacerWidth / 2, bottom,
rectangle.X + rectangle.Width - SpacerWidth / 2, rectangle.Y,
rectangle.X + rectangle.Width, rectangle.Y);
cr.Color = (HslColor)parent.Style.Dark(StateType.Normal);
cr.StrokePreserve();
cr.ClosePath();
if (Active)
{
cr.Color = (HslColor)parent.Style.Background(StateType.Prelight);
}
else if (HoverPosition.X >= 0)
{
double rx = rectangle.X + HoverPosition.X;
double ry = rectangle.Y + HoverPosition.Y;
Cairo.RadialGradient gradient = new Cairo.RadialGradient(rx, ry, rectangle.Height * 1.5,
rx, ry, 2);
var color = (HslColor)parent.Style.Mid(StateType.Normal);
color.L *= 1.05;
gradient.AddColorStop(0, color);
color.L *= 1.07;
gradient.AddColorStop(1, color);
cr.Pattern = gradient;
}
else
{
cr.Color = (HslColor)parent.Style.Mid(StateType.Normal);
}
cr.Fill();
cr.Save();
cr.Translate(rectangle.X + (rectangle.Width - w) / 2, (rectangle.Height - h) / 2);
cr.Color = (HslColor)parent.Style.Text(StateType.Normal);
cr.ShowLayout(layout);
cr.Restore();
}