Browse Source

Fixed bug introduced in revision 3744 (see SD2-1383)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3750 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
24b1a71f09
  1. 33
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs
  2. 3
      src/Libraries/DockPanel_Src/patchnotes.txt

33
src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs

@ -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))

3
src/Libraries/DockPanel_Src/patchnotes.txt

@ -32,4 +32,5 @@ Patch #5: @@ -32,4 +32,5 @@ Patch #5:
Patch #6:
In VS2005DockPaneStrip.cs: fixed SD2-1383
Committed in revision 3744.
Committed in revision 3744.
Bug introduced in patch was fixed in revision 3750.

Loading…
Cancel
Save