This commit is contained in:
jlewin 2019-06-17 18:12:34 -07:00
parent 19a7fba3a6
commit 95ae04b790
9 changed files with 397 additions and 51 deletions

View file

@ -220,6 +220,17 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
OnBeforeSelect(null);
if (_selectedNode != null)
{
// Collapse the old tree
foreach (var ancestor in _selectedNode.Parents<TreeNode>())
{
ancestor.Expanded = false;
}
_selectedNode.Expanded = false;
}
// if the current selection (before change) is !null than clear its background color
if (_selectedNode != null)
{
@ -229,11 +240,22 @@ namespace MatterHackers.MatterControl.CustomWidgets
// change the selection
_selectedNode = value;
if (_selectedNode != null)
{
// Expand the new tree
foreach (var ancestor in _selectedNode.Parents<TreeNode>())
{
ancestor.Expanded = true;
}
}
if (_selectedNode != null)
{
_selectedNode.HighlightRegion.BackgroundColor = theme.AccentMimimalOverlay;
}
OnAfterSelect(null);
}
}