Handle unassigned color case

This commit is contained in:
John Lewin 2018-09-08 11:16:45 -07:00
parent c96fc4c048
commit ae0808875e
2 changed files with 4 additions and 1 deletions

View file

@ -215,7 +215,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var selectedItem = scene.SelectedItem;
if (selectedItem != null)
{
itemColorButton.Color = scene.SelectedItem.Color;
itemColorButton.Color = (scene.SelectedItem.Color == Color.Transparent) ? theme.MinimalHighlight : scene.SelectedItem.Color;
itemMaterialButton.Color = MaterialRendering.Color(scene.SelectedItem.MaterialIndex, theme.MinimalHighlight);
}

View file

@ -80,6 +80,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
resetButton.Click += (s, e) =>
{
scene.UndoBuffer.AddAndDo(new ChangeColor(scene.SelectedItem, Color.Transparent));
// The colorChanged action displays the given color - use .MinimalHighlight rather than no color
colorChanged(theme.MinimalHighlight);
};
colorRow.AddChild(resetButton);
break;