Merge pull request #4087 from jlewin/master

Restore default "Calibration Parts" library container
This commit is contained in:
johnlewin 2018-12-14 13:45:39 -08:00 committed by GitHub
commit 70f57ee621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -168,11 +168,12 @@ namespace MatterHackers.MatterControl.ActionBar
private void EnableControls()
{
bool status = printer.Connection.IsConnected && !printer.Connection.PrinterIsPrinting;
if (isEnabled != status)
if (isEnabled != status
&& this.PopupContent is GuiWidget popupContent)
{
isEnabled = status;
var flowLayout = this.PopupContent.Children.OfType<FlowLayoutWidget>().FirstOrDefault();
var flowLayout = popupContent.Children.OfType<FlowLayoutWidget>().FirstOrDefault();
if (flowLayout != null)
{
foreach (var child in flowLayout.Children.Except(alwaysEnabled))

View file

@ -54,6 +54,16 @@ namespace MatterHackers.MatterControl.Library
() => new SqliteLibraryContainer(rootLibraryCollection.Id)));
}
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Calibration Parts".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder_20x20.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
() => new CalibrationPartsContainer())
{
IsReadOnly = true
});
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Primitives".Localize(),