Skip to content

Commit

Permalink
Fixed text rendering issue on document tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Jun 2, 2013
1 parent 569e1f9 commit abf7855
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions WinFormsUI/Docking/VS2012LightDockPaneStrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit abf7855

Please sign in to comment.