From 7e67ab1e6930745f3c1ea7ec14066319d693f1a4 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Wed, 9 Mar 2016 19:30:19 +0000 Subject: [PATCH] Only invalidate underneath tabs when on Windows 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. --- Classes/TabBarRenderer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/TabBarRenderer.cs b/Classes/TabBarRenderer.cs index ce08198b..a8c17969 100644 --- a/Classes/TabBarRenderer.cs +++ b/Classes/TabBarRenderer.cs @@ -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 @@ -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) {