Browse Source

fixed SD2-1383 - Long file name displayed in view title

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3744 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
6eaee68ad4
  1. 59
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs
  2. 4
      src/Libraries/DockPanel_Src/patchnotes.txt

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

@ -309,6 +309,25 @@ namespace WeifenLuo.WinFormsUI.Docking
} }
} }
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 private static int DocumentStripGapTop
{ {
get { return _DocumentStripGapTop; } get { return _DocumentStripGapTop; }
@ -335,6 +354,23 @@ namespace WeifenLuo.WinFormsUI.Docking
} }
} }
private StringFormat DocumentStringFormat
{
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;
return format;
}
}
private static int DocumentTabMaxWidth private static int DocumentTabMaxWidth
{ {
get { return _DocumentTabMaxWidth; } get { return _DocumentTabMaxWidth; }
@ -1044,7 +1080,8 @@ namespace WeifenLuo.WinFormsUI.Docking
{ {
g.FillPath(BrushToolWindowActiveBackground, path); g.FillPath(BrushToolWindowActiveBackground, path);
g.DrawPath(PenToolWindowTabBorder, path); g.DrawPath(PenToolWindowTabBorder, path);
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowActiveText, ToolWindowTextFormat); using (SolidBrush brush = new SolidBrush(ColorToolWindowActiveText))
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush, rectText, ToolWindowStringFormat);
} }
else else
{ {
@ -1054,7 +1091,8 @@ namespace WeifenLuo.WinFormsUI.Docking
Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom);
g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2)); g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
} }
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowInactiveText, ToolWindowTextFormat); using (SolidBrush brush = new SolidBrush(ColorToolWindowInactiveText))
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush, rectText, ToolWindowStringFormat);
} }
if (rectTab.Contains(rectIcon)) if (rectTab.Contains(rectIcon))
@ -1090,16 +1128,23 @@ namespace WeifenLuo.WinFormsUI.Docking
{ {
g.FillPath(BrushDocumentActiveBackground, path); g.FillPath(BrushDocumentActiveBackground, path);
g.DrawPath(PenDocumentTabActiveBorder, path); g.DrawPath(PenDocumentTabActiveBorder, path);
if (DockPane.IsActiveDocumentPane) if (DockPane.IsActiveDocumentPane) {
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, ColorDocumentActiveText, DocumentTextFormat); using (SolidBrush brush = new SolidBrush(ColorDocumentActiveText))
else g.DrawString(tab.Content.DockHandler.TabText, BoldFont, brush,
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentActiveText, DocumentTextFormat); rectText, DocumentStringFormat);
} else {
using (SolidBrush brush = new SolidBrush(ColorDocumentActiveText))
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush,
rectText, DocumentStringFormat);
}
} }
else else
{ {
g.FillPath(BrushDocumentInactiveBackground, path); g.FillPath(BrushDocumentInactiveBackground, path);
g.DrawPath(PenDocumentTabInactiveBorder, path); g.DrawPath(PenDocumentTabInactiveBorder, path);
TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentInactiveText, DocumentTextFormat); using (SolidBrush brush = new SolidBrush(ColorDocumentInactiveText))
g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush,
rectText, DocumentStringFormat);
} }
if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon) if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)

4
src/Libraries/DockPanel_Src/patchnotes.txt

@ -29,3 +29,7 @@ Patch #5:
In DockContentHandler.SetVisible: In DockContentHandler.SetVisible:
Ensure pad visibility is set correctly, even when Windows.Forms is "lying" about Form.Visible. Ensure pad visibility is set correctly, even when Windows.Forms is "lying" about Form.Visible.
Committed in revision 3061. Committed in revision 3061.
Patch #6:
In VS2005DockPaneStrip.cs: fixed SD2-1383
Committed in revision 3744.
Loading…
Cancel
Save