From 09dbb18021a29956a2e367a791df2988bbf18052 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 29 Oct 2018 21:47:03 -0700 Subject: [PATCH] Collapse WidescreenPanel into PartPreviewContent --- .../ApplicationView/ApplicationController.cs | 4 +-- ...{WidescreenPanel.cs => BrandMenuButton.cs} | 33 +------------------ .../PartPreviewWindow/PartPreviewContent.cs | 5 +++ .../Io/BabyStepsStream.cs | 1 - .../MatterControl/MatterControlUtilities.cs | 4 +-- .../MatterControl/ReleaseBuildTests.cs | 2 +- 6 files changed, 11 insertions(+), 38 deletions(-) rename MatterControlLib/ApplicationView/{WidescreenPanel.cs => BrandMenuButton.cs} (90%) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 60158c853..192ed4bbd 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -1682,7 +1682,7 @@ namespace MatterHackers.MatterControl GuiWidget.LayoutCount = 0; using (new QuickTimer($"ReloadAll_{reloadCount++}:")) { - MainView = new WidescreenPanel(ApplicationController.Instance.Theme); + MainView = new PartPreviewContent(ApplicationController.Instance.Theme); this.DoneReloadingAll?.CallEvents(null, null); using (new QuickTimer("Time to AddMainview: ")) @@ -3141,7 +3141,7 @@ If you experience adhesion problems, please re-run leveling." } reporter?.Invoke(0.3, (loading != null) ? loading : "MainView"); - applicationController.MainView = new WidescreenPanel(applicationController.Theme); + applicationController.MainView = new PartPreviewContent(applicationController.Theme); // now that we are all set up lets load our plugins and allow them their chance to set things up reporter?.Invoke(0.8, (loading != null) ? loading : "Plugins"); diff --git a/MatterControlLib/ApplicationView/WidescreenPanel.cs b/MatterControlLib/ApplicationView/BrandMenuButton.cs similarity index 90% rename from MatterControlLib/ApplicationView/WidescreenPanel.cs rename to MatterControlLib/ApplicationView/BrandMenuButton.cs index c76a85c56..2f8aedaf9 100644 --- a/MatterControlLib/ApplicationView/WidescreenPanel.cs +++ b/MatterControlLib/ApplicationView/BrandMenuButton.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2018, Kevin Pope, John Lewin +Copyright (c) 2018, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,37 +41,6 @@ using MatterHackers.VectorMath; namespace MatterHackers.MatterControl { - public class WidescreenPanel : FlowLayoutWidget - { - private ThemeConfig theme; - - public WidescreenPanel(ThemeConfig theme) - { - this.theme = theme; - } - - public override void Initialize() - { - base.Initialize(); - - this.AnchorAll(); - this.Name = "WidescreenPanel"; - this.BackgroundColor = theme.ActiveTabColor; - - // Push TouchScreenMode into GuiWidget - GuiWidget.TouchScreenMode = UserSettings.Instance.IsTouchScreen; - - // put in the right column - var partPreviewContent = new PartPreviewContent(theme) - { - VAnchor = VAnchor.Bottom | VAnchor.Top, - HAnchor = HAnchor.Left | HAnchor.Right - }; - - this.AddChild(partPreviewContent); - } - } - public class BrandMenuButton : PopupMenuButton { public BrandMenuButton(ThemeConfig theme) diff --git a/MatterControlLib/PartPreviewWindow/PartPreviewContent.cs b/MatterControlLib/PartPreviewWindow/PartPreviewContent.cs index 9ccae05f2..4dac34c65 100644 --- a/MatterControlLib/PartPreviewWindow/PartPreviewContent.cs +++ b/MatterControlLib/PartPreviewWindow/PartPreviewContent.cs @@ -56,6 +56,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { this.AnchorAll(); this.theme = theme; + this.Name = "PartPreviewContent"; + this.BackgroundColor = theme.ActiveTabColor; + + // Push TouchScreenMode into GuiWidget + GuiWidget.TouchScreenMode = UserSettings.Instance.IsTouchScreen; var extensionArea = new LeftClipFlowLayoutWidget() { diff --git a/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs b/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs index 2b4489737..3719e2796 100644 --- a/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs @@ -53,7 +53,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { OffsetChanged(); } - }, ref unregisterEvents); maxLengthStream = new MaxLengthStream(internalStream, startingMaxLength); diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index e1e7f91fc..8638a8021 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -170,7 +170,7 @@ namespace MatterHackers.MatterControl.Tests.Automation public static void WaitForFirstDraw(this AutomationRunner testRunner) { - testRunner.GetWidgetByName("WidescreenPanel", out SystemWindow systemWindow, 10); + testRunner.GetWidgetByName("PartPreviewContent", out SystemWindow systemWindow, 10); // make sure we wait for MC to be up and running testRunner.WaitforDraw(systemWindow); } @@ -302,7 +302,7 @@ namespace MatterHackers.MatterControl.Tests.Automation public static void AddAndSelectPrinter(this AutomationRunner testRunner, string make = "Airwolf 3D", string model = "HD") { - testRunner.GetWidgetByName("WidescreenPanel", out SystemWindow systemWindow, 10); + testRunner.GetWidgetByName("PartPreviewContent", out SystemWindow systemWindow, 10); // make sure we wait for MC to be up and running testRunner.WaitforDraw(systemWindow); diff --git a/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs b/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs index 547f9496a..c167f7df8 100644 --- a/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs @@ -97,7 +97,7 @@ namespace MatterControl.Tests { await MatterControlUtilities.RunTest((testRunner) => { - Assert.IsTrue(testRunner.NameExists("WidescreenPanel")); + Assert.IsTrue(testRunner.NameExists("PartPreviewContent")); return Task.CompletedTask; });