Disable bed volume in 2D GCode view
- Issue MatterHackers/MCCentral#3053
This commit is contained in:
parent
412c7acde2
commit
718d2b00c7
1 changed files with 20 additions and 2 deletions
|
|
@ -1803,8 +1803,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
RadioIconButton printAreaButton = null;
|
||||
|
||||
if (sceneContext.BuildHeight > 0
|
||||
&& printer?.ViewState.ViewMode != PartViewMode.Layers2D)
|
||||
if (sceneContext.BuildHeight > 0)
|
||||
{
|
||||
printAreaButton = new RadioIconButton(AggContext.StaticData.LoadIcon("print_area.png", IconColor.Theme), theme)
|
||||
{
|
||||
|
|
@ -1813,6 +1812,7 @@ namespace MatterHackers.MatterControl
|
|||
Checked = sceneContext.RendererOptions.RenderBuildVolume,
|
||||
Margin = theme.ButtonSpacing,
|
||||
ToggleButton = true,
|
||||
Enabled = printer?.ViewState.ViewMode != PartViewMode.Layers2D,
|
||||
Height = 24,
|
||||
Width = 24
|
||||
};
|
||||
|
|
@ -1825,6 +1825,22 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.BindBedOptions(container, bedButton, printAreaButton, sceneContext.RendererOptions);
|
||||
|
||||
if (printer != null)
|
||||
{
|
||||
// Disable print area button in GCode2D view
|
||||
EventHandler<ViewModeChangedEventArgs> viewModeChanged = (s, e) =>
|
||||
{
|
||||
printAreaButton.Enabled = printer.ViewState.ViewMode != PartViewMode.Layers2D;
|
||||
};
|
||||
|
||||
printer.ViewState.ViewModeChanged += viewModeChanged;
|
||||
|
||||
container.Closed += (s, e) =>
|
||||
{
|
||||
printer.ViewState.ViewModeChanged -= viewModeChanged;
|
||||
};
|
||||
}
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -1844,6 +1860,8 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
renderOptions.PropertyChanged += syncProperties;
|
||||
|
||||
container.Closed += (s, e) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue