Permalink
Browse files

Fixed text rendering issue on document tabs.

  • Loading branch information...
lextm committed Jun 2, 2013
1 parent 569e1f9 commit abf7855eee138459332d6f457bf5f757182892bf
Showing with 3 additions and 6 deletions.
  1. +3 −6 WinFormsUI/Docking/VS2012LightDockPaneStrip.cs
@@ -1149,6 +1149,7 @@ private void DrawTab_Document(Graphics g, TabVS2012Light tab, Rectangle rect)
if (tab.TabWidth == 0)
return;
+ var rectCloseButton = GetCloseButtonRect(rect);
Rectangle rectIcon = new Rectangle(
rect.X + DocumentIconGapLeft,
rect.Y + rect.Height - DocumentIconGapBottom - DocumentIconHeight,
@@ -1158,12 +1159,11 @@ private void DrawTab_Document(Graphics g, TabVS2012Light tab, Rectangle rect)
{
rectText.X += rectIcon.Width + DocumentIconGapRight;
rectText.Y = rect.Y;
- rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
- DocumentIconGapRight - DocumentTextGapRight;
+ rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft - DocumentIconGapRight - DocumentTextGapRight - rectCloseButton.Width;
rectText.Height = rect.Height;
}
else
- rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;
+ rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight - rectCloseButton.Width;
Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
Rectangle rectBack = DrawHelper.RtlTransform(this, rect);
@@ -1182,9 +1182,6 @@ private void DrawTab_Document(Graphics g, TabVS2012Light tab, Rectangle rect)
Color inactiveText = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor;
Color lostFocusText = SystemColors.GrayText;
- /* Draw the close Button on the active tab */
- var rectCloseButton = GetCloseButtonRect(rect);
-
if (DockPane.ActiveContent == tab.Content)
{
if (DockPane.IsActiveDocumentPane)

0 comments on commit abf7855

Please sign in to comment.