mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Allow specifying a background colour per-column on a TreeListNode
This commit is contained in:
@@ -26,6 +26,8 @@ namespace TreelistView
|
||||
Color m_backCol = Color.Transparent;
|
||||
Color m_defbackCol = Color.Transparent;
|
||||
|
||||
Color[] m_backCols = null;
|
||||
|
||||
public TreeListView OwnerView = null;
|
||||
|
||||
public Node Parent
|
||||
@@ -146,15 +148,24 @@ namespace TreelistView
|
||||
get { return m_defbackCol; }
|
||||
set { m_defbackCol = value; }
|
||||
}
|
||||
public Color[] IndexedBackColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_backCols;
|
||||
}
|
||||
}
|
||||
|
||||
public Node()
|
||||
{
|
||||
m_data = new object[1];
|
||||
}
|
||||
public Node(string text)
|
||||
{
|
||||
m_data = new object[1] {text};
|
||||
}
|
||||
public Node()
|
||||
{
|
||||
m_data = new object[1];
|
||||
m_backCols = new Color[1] { Color.Transparent };
|
||||
}
|
||||
public Node(string text)
|
||||
{
|
||||
m_data = new object[1] { text };
|
||||
m_backCols = new Color[1] { Color.Transparent };
|
||||
}
|
||||
public Node(object[] fields)
|
||||
{
|
||||
SetData(fields);
|
||||
@@ -196,11 +207,14 @@ namespace TreelistView
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
public void SetData(object[] fields)
|
||||
{
|
||||
m_data = new object[fields.Length];
|
||||
fields.CopyTo(m_data, 0);
|
||||
}
|
||||
public void SetData(object[] fields)
|
||||
{
|
||||
m_data = new object[fields.Length];
|
||||
fields.CopyTo(m_data, 0);
|
||||
|
||||
m_backCols = new Color[fields.Length];
|
||||
for (int i = 0; i < fields.Length; i++) m_backCols[i] = Color.Transparent;
|
||||
}
|
||||
public int VisibleNodeCount
|
||||
{
|
||||
get
|
||||
|
||||
@@ -201,6 +201,9 @@ namespace TreelistView
|
||||
|
||||
if (node.BackColor != Color.Transparent)
|
||||
c = node.BackColor;
|
||||
|
||||
if (column.Index < node.IndexedBackColor.Length && node.IndexedBackColor[column.Index] != Color.Transparent)
|
||||
c = node.IndexedBackColor[column.Index];
|
||||
|
||||
if (!m_owner.NodesSelection.Contains(node) && m_owner.FocusedNode != node &&
|
||||
!(hoverNode == node && m_owner.RowOptions.HoverHighlight) &&
|
||||
|
||||
Reference in New Issue
Block a user