diff --git a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs index bf5bd8b6f..53b30f135 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs @@ -96,6 +96,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public IEnumerable Drawables => drawables; + public IEnumerable ItemDrawables => itemDrawables; + internal void SetRenderTarget(GuiWidget renderSource) { this.renderSource = renderSource; diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs index ff519d144..6c8c2881e 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs @@ -160,6 +160,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow row.AddChild(toggleSwitch); } + foreach (var drawable in ApplicationController.Instance.DragDropData.View3DWidget.InteractionLayer.ItemDrawables) + { + var row = new SettingsRow(drawable.Title, drawable.Description, theme); + subPanel.AddChild(row); + + var toggleSwitch = new RoundedToggleSwitch(theme) + { + Checked = drawable.Enabled + }; + toggleSwitch.CheckedStateChanged += (s, e) => + { + drawable.Enabled = toggleSwitch.Checked; + }; + row.AddChild(toggleSwitch); + } + menuTheme.ApplyBoxStyle(sectionWidget); sectionWidget.Margin = new BorderDouble(0, 10);