mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 17:36:36 +00:00
Add treelistview custom tree lines (colour/width) and text colour
This commit is contained in:
@@ -996,8 +996,10 @@ namespace TreelistView
|
||||
int indentSize = GetIndentSize(node) + 5;
|
||||
cellRect.X += indentSize;
|
||||
cellRect.Width -= indentSize;
|
||||
if (ViewOptions.ShowLine)
|
||||
PaintLines(dc, cellRect, node);
|
||||
|
||||
// save rectangle for line drawing below
|
||||
Rectangle lineCellRect = cellRect;
|
||||
|
||||
cellRect.X += lineindet;
|
||||
cellRect.Width -= lineindet;
|
||||
|
||||
@@ -1015,7 +1017,10 @@ namespace TreelistView
|
||||
|
||||
Image icon = hoverNode != null && hoverNode == node ? GetHoverNodeBitmap(node) : GetNodeBitmap(node);
|
||||
|
||||
PaintCellBackground(dc, cellRect, node, col);
|
||||
PaintCellBackground(dc, cellRect, node, col);
|
||||
|
||||
if (ViewOptions.ShowLine)
|
||||
PaintLines(dc, lineCellRect, node);
|
||||
|
||||
if (SelectedImage != null && (NodesSelection.Contains(node) || FocusedNode == node))
|
||||
{
|
||||
@@ -1079,9 +1084,16 @@ namespace TreelistView
|
||||
Node parent = node.Parent;
|
||||
while (parent != null)
|
||||
{
|
||||
Pen linePen = null;
|
||||
if (parent.TreeLineColor != Color.Transparent || parent.TreeLineWidth > 0.0f)
|
||||
linePen = new Pen(parent.TreeLineColor, parent.TreeLineWidth);
|
||||
|
||||
cellRect.X -= ViewOptions.Indent;
|
||||
dc.DrawLine(pen, cellRect.X, cellRect.Top, cellRect.X, cellRect.Bottom);
|
||||
dc.DrawLine(linePen != null ? linePen : pen, cellRect.X, cellRect.Top, cellRect.X, cellRect.Bottom);
|
||||
parent = parent.Parent;
|
||||
|
||||
if (linePen != null)
|
||||
linePen.Dispose();
|
||||
}
|
||||
|
||||
pen.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user