Skip to content

Commit

Permalink
Only invalidate underneath tabs when on Windows
Browse files Browse the repository at this point in the history
On Windows it is necessary to invalidate the section of the tab bar
underneath the buttons to ensure that it gets re-painted correctly and
gives the illusion that the active tab continues to the edge of the
control.  However, under linux this is unnecessary and causes the rest
of the form to never be painted, so only call Invalidate on Windows.
  • Loading branch information
ribbons committed Jul 30, 2016
1 parent ac3b0a1 commit 7e67ab1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/TabBarRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Radio Downloader.
* Copyright © 2007-2012 by the authors - see the AUTHORS file for details.
* Copyright © 2007-2016 by the authors - see the AUTHORS file for details.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -178,8 +178,11 @@ protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
{
colour = activeTabBkg;

// Invalidate between the buttons and the bottom of the toolstrip so that it gets repainted
e.ToolStrip.Invalidate(new Rectangle(0, e.Item.Bounds.Bottom, e.ToolStrip.Bounds.Width, e.ToolStrip.Bounds.Height - e.Item.Bounds.Bottom));
if (OsUtils.Windows())
{
// Invalidate between the buttons and the bottom of the toolstrip so that it gets repainted
e.ToolStrip.Invalidate(new Rectangle(0, e.Item.Bounds.Bottom, e.ToolStrip.Bounds.Width, e.ToolStrip.Bounds.Height - e.Item.Bounds.Bottom));
}
}
else if (e.Item.Selected)
{
Expand Down

0 comments on commit 7e67ab1

Please sign in to comment.