From: Thomas Goldstein Date: Fri, 11 Feb 2011 23:12:54 +0000 (+0100) Subject: TabControlPainter.cs: Move up the Text / Image of the selected tab, matching .NET. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=28a47b5d39f10c913a1d484259470abf061f8284;p=mono.git TabControlPainter.cs: Move up the Text / Image of the selected tab, matching .NET. --- diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/TabControlPainter.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/TabControlPainter.cs index f3d4e9f181e..0d32cb96b82 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/TabControlPainter.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/TabControlPainter.cs @@ -446,6 +446,16 @@ namespace System.Windows.Forms.Theming.Default } else { Rectangle str_rect = interior; + if (is_selected) { + // Reduce the interior size to match the inner size of non-selected tabs + str_rect.X += selectedTabDelta.X; + str_rect.Y += selectedTabDelta.Y; + str_rect.Width -= selectedTabDelta.Width; + str_rect.Height -= selectedTabDelta.Height; + + str_rect.Y -= selectedTabDelta.Y; // Move up the text / image of the selected tab + } + if (tab.ImageList != null && page.ImageIndex >= 0 && page.ImageIndex < tab.ImageList.Images.Count) { int image_x; if (tab.SizeMode != TabSizeMode.Fixed) {