Skip to content

Commit

Permalink
Draw tab background without overwriting border on Mono
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jan 7, 2020
1 parent d917cc0 commit 0ed238e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GUI/ThemedTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ public ThemedTabControl() : base()
protected override void OnDrawItem(DrawItemEventArgs e)
{
// Background
e.Graphics.FillRectangle(new SolidBrush(BackColor), e.Bounds);
Rectangle bgRect = e.Bounds;
bgRect.Inflate(-2, -1);
e.Graphics.FillRectangle(new SolidBrush(BackColor), bgRect);
// Text
var tabPage = TabPages[e.Index];
Rectangle rect = e.Bounds;
rect.Offset(1, 1);
TextRenderer.DrawText(e.Graphics, tabPage.Text, tabPage.Font,
rect, tabPage.ForeColor);
// Alert event subscribers
Expand Down

0 comments on commit 0ed238e

Please sign in to comment.