protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if (renderer is ToolStripSystemRenderer)
     {
         if (e.ToolStrip is ToolStripDropDownMenu)
         {
             renderer.DrawSeparator(e);
         }
         else
         {
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(SystemPens.ControlDark, middle - 1, e.Item.ContentRectangle.Top + 1, middle - 1, e.Item.ContentRectangle.Bottom - 2);
             e.Graphics.DrawLine(SystemPens.ControlLightLight, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2);
         }
     }
     else if (e.Item is ToolStripSeparator && e.Vertical)
     {
         Color light = GetThemeColor("ToolStrip.3dLightColor");
         Color dark  = GetThemeColor("ToolStrip.3dDarkColor");
         if (dark != Color.Empty && light != Color.Empty)
         {
             Pen   pen    = new Pen(dark);
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(pen, middle - 1, e.Item.ContentRectangle.Top + 2, middle - 1, e.Item.ContentRectangle.Bottom - 4);
             pen.Dispose();
             Pen pen2 = new Pen(light);
             e.Graphics.DrawLine(pen2, middle, e.Item.ContentRectangle.Top + 2, middle, e.Item.ContentRectangle.Bottom - 4);
             pen2.Dispose();
         }
         else
         {
             renderer.DrawSeparator(e);
         }
     }
     else
     {
         Color sepFore = GetThemeColor("ToolStripSeparator.ForeColor");
         if (sepFore != Color.Empty)
         {
             Pen   pen2   = new Pen(sepFore);
             Int32 middle = e.Item.ContentRectangle.Top + e.Item.ContentRectangle.Height / 2;
             e.Graphics.DrawLine(pen2, ScaleHelper.Scale(16) + 16, middle, e.Item.ContentRectangle.Right - 6, middle);
             pen2.Dispose();
         }
         else
         {
             renderer.DrawSeparator(e);
         }
     }
 }
示例#2
0
 protected override void OnRenderSeparator(System.Windows.Forms.ToolStripSeparatorRenderEventArgs e)
 {
     if (currentRenderer != null)
     {
         currentRenderer.DrawSeparator(e);
         return;
     }
     base.OnRenderSeparator(e);
 }
示例#3
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if (renderer is ToolStripSystemRenderer)
     {
         if (e.ToolStrip is ToolStripDropDownMenu)
         {
             renderer.DrawSeparator(e);
             Pen pen = new Pen(SystemColors.ControlDark);
             e.Graphics.DrawLine(pen, e.Item.ContentRectangle.Left, e.Item.ContentRectangle.Top, e.Item.ContentRectangle.Right, e.Item.ContentRectangle.Top);
             pen.Dispose();
         }
         else
         {
             Pen   pen    = new Pen(SystemColors.ControlDark);
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(pen, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2);
             pen.Dispose();
         }
     }
     else if (e.Item is ToolStripSeparator && e.Vertical)
     {
         Color light = PluginBase.MainForm.GetThemeColor("ToolStrip.3dLightColor");
         Color dark  = PluginBase.MainForm.GetThemeColor("ToolStrip.3dDarkColor");
         if (dark != Color.Empty && light != Color.Empty)
         {
             Pen   pen    = new Pen(dark);
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(pen, middle - 1, e.Item.ContentRectangle.Top + 2, middle - 1, e.Item.ContentRectangle.Bottom - 4);
             pen.Dispose();
             Pen pen2 = new Pen(light);
             e.Graphics.DrawLine(pen2, middle, e.Item.ContentRectangle.Top + 2, middle, e.Item.ContentRectangle.Bottom - 4);
             pen2.Dispose();
         }
         else
         {
             renderer.DrawSeparator(e);
         }
     }
     else
     {
         renderer.DrawSeparator(e);
     }
 }
示例#4
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if (_currentRenderer != null)
     {
         _currentRenderer.DrawSeparator(e);
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
示例#5
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if (renderer is ToolStripSystemRenderer)
     {
         if (e.ToolStrip is ToolStripDropDownMenu)
         {
             renderer.DrawSeparator(e);
         }
         else
         {
             Pen   pen    = new Pen(SystemColors.InactiveBorder);
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(pen, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2);
             pen.Dispose();
         }
     }
     else
     {
         renderer.DrawSeparator(e);
     }
 }