Browse Source

When a tree node in the ExtTreeView is selected, but the control does not currently have the focus, the node's text colour is set to ControlText and not the node's ForeColor. This makes the ExtTreeView consistent with the .NET framework TreeView.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1066 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
5c474f46a7
  1. 8
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

8
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

@ -283,13 +283,7 @@ namespace ICSharpCode.SharpDevelop.Gui
// HACK: work around TreeView bug in OwnerDrawText mode: // HACK: work around TreeView bug in OwnerDrawText mode:
// overpaint blue selection with the correct gray selection // overpaint blue selection with the correct gray selection
e.Graphics.FillRectangle(SystemBrushes.Control, e.Bounds); e.Graphics.FillRectangle(SystemBrushes.Control, e.Bounds);
if (e.Node.ForeColor.IsEmpty) { e.Graphics.DrawString(e.Node.Text, this.Font, SystemBrushes.ControlText, e.Bounds.Location);
e.Graphics.DrawString(e.Node.Text, this.Font, SystemBrushes.ControlText, e.Bounds.Location);
} else {
using (Brush brush = new SolidBrush(e.Node.ForeColor)) {
e.Graphics.DrawString(e.Node.Text, this.Font, brush, e.Bounds.Location);
}
}
e.DrawDefault = false; e.DrawDefault = false;
} else { } else {
e.DrawDefault = true; e.DrawDefault = true;

Loading…
Cancel
Save