Handle unassigned color case
This commit is contained in:
parent
c96fc4c048
commit
ae0808875e
2 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue