|
|
|
@ -308,26 +308,7 @@ namespace WeifenLuo.WinFormsUI.Docking
@@ -308,26 +308,7 @@ namespace WeifenLuo.WinFormsUI.Docking
|
|
|
|
|
return textFormat; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private StringFormat ToolWindowStringFormat |
|
|
|
|
{ |
|
|
|
|
get |
|
|
|
|
{ |
|
|
|
|
StringFormat format = new StringFormat(); |
|
|
|
|
format.Alignment = StringAlignment.Center; |
|
|
|
|
format.LineAlignment = StringAlignment.Center; |
|
|
|
|
format.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.NoClip; |
|
|
|
|
format.Trimming = StringTrimming.EllipsisPath; |
|
|
|
|
|
|
|
|
|
if (RightToLeft == RightToLeft.Yes) { |
|
|
|
|
format.FormatFlags |= StringFormatFlags.DirectionRightToLeft; |
|
|
|
|
format.LineAlignment = StringAlignment.Near; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return format; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static int DocumentStripGapTop |
|
|
|
|
{ |
|
|
|
|
get { return _DocumentStripGapTop; } |
|
|
|
@ -870,7 +851,11 @@ namespace WeifenLuo.WinFormsUI.Docking
@@ -870,7 +851,11 @@ namespace WeifenLuo.WinFormsUI.Docking
|
|
|
|
|
|
|
|
|
|
int height = GetTabRectangle_Document(index).Height; |
|
|
|
|
|
|
|
|
|
Size sizeText = TextRenderer.MeasureText(content.DockHandler.TabText, BoldFont, new Size(DocumentTabMaxWidth, height), DocumentTextFormat); |
|
|
|
|
Size sizeText; |
|
|
|
|
using (Graphics g = CreateGraphics()) { |
|
|
|
|
SizeF sizeTextF = g.MeasureString(content.DockHandler.TabText, BoldFont, new Size(DocumentTabMaxWidth, height), DocumentStringFormat); |
|
|
|
|
sizeText = new Size((int)Math.Ceiling(sizeTextF.Width), (int)Math.Ceiling(sizeTextF.Height)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (DockPane.DockPanel.ShowDocumentIcon) |
|
|
|
|
return sizeText.Width + DocumentIconWidth + DocumentIconGapLeft + DocumentIconGapRight + DocumentTextGapRight; |
|
|
|
@ -1080,8 +1065,7 @@ namespace WeifenLuo.WinFormsUI.Docking
@@ -1080,8 +1065,7 @@ namespace WeifenLuo.WinFormsUI.Docking
|
|
|
|
|
{ |
|
|
|
|
g.FillPath(BrushToolWindowActiveBackground, path); |
|
|
|
|
g.DrawPath(PenToolWindowTabBorder, path); |
|
|
|
|
using (SolidBrush brush = new SolidBrush(ColorToolWindowActiveText)) |
|
|
|
|
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush, rectText, ToolWindowStringFormat); |
|
|
|
|
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowActiveText, ToolWindowTextFormat); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -1091,8 +1075,7 @@ namespace WeifenLuo.WinFormsUI.Docking
@@ -1091,8 +1075,7 @@ namespace WeifenLuo.WinFormsUI.Docking
|
|
|
|
|
Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); |
|
|
|
|
g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2)); |
|
|
|
|
} |
|
|
|
|
using (SolidBrush brush = new SolidBrush(ColorToolWindowInactiveText)) |
|
|
|
|
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush, rectText, ToolWindowStringFormat); |
|
|
|
|
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowInactiveText, ToolWindowTextFormat); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (rectTab.Contains(rectIcon)) |
|
|
|
|