Add item Drawables to menu

This commit is contained in:
John Lewin 2019-02-02 13:51:02 -08:00
parent e9b79e1099
commit 330aba83f7
2 changed files with 18 additions and 0 deletions

View file

@ -96,6 +96,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public IEnumerable<IDrawable> Drawables => drawables;
public IEnumerable<IDrawableItem> ItemDrawables => itemDrawables;
internal void SetRenderTarget(GuiWidget renderSource)
{
this.renderSource = renderSource;

View file

@ -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);