diff --git a/MatterControlLib/CustomWidgets/TreeView/TreeView.cs b/MatterControlLib/CustomWidgets/TreeView/TreeView.cs index e11d64b89..64c983cce 100644 --- a/MatterControlLib/CustomWidgets/TreeView/TreeView.cs +++ b/MatterControlLib/CustomWidgets/TreeView/TreeView.cs @@ -228,11 +228,13 @@ namespace MatterHackers.MatterControl.CustomWidgets { OnBeforeSelect(null); + // if the current selection (before change) is !null than clear its background color if (_selectedNode != null) { _selectedNode.HighlightRegion.BackgroundColor = Color.Transparent; } + // change the selection _selectedNode = value; if (_selectedNode != null) diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs index 5da2573a7..e816b1090 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs @@ -28,8 +28,11 @@ either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg; +using MatterHackers.Agg.Image; +using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; using MatterHackers.Localizations; +using System.IO; namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { @@ -72,6 +75,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections }; container.AddChild(printerMessageThree); + var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "remove usb.png")); + removeImage.SetRecieveBlender(new BlenderPreMultBGRA()); + container.AddChild(new ImageWidget(removeImage) + { + HAnchor = HAnchor.Center, + Margin = new BorderDouble(0, 10), + }); + GuiWidget vSpacer = new GuiWidget(); vSpacer.VAnchor = VAnchor.Stretch; container.AddChild(vSpacer); diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs index d0ca0198a..8e5cea04b 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs @@ -28,8 +28,11 @@ either expressed or implied, of the FreeBSD Project. */ using System; +using System.IO; using System.Linq; using MatterHackers.Agg; +using MatterHackers.Agg.Image; +using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; using MatterHackers.Localizations; using MatterHackers.MatterControl.PrinterCommunication; @@ -82,9 +85,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections } }; + var backButton = theme.CreateDialogButton("<< Back".Localize()); + backButton.Click += (s, e) => + { + DialogWindow.ChangeToPage(new SetupStepComPortOne(printer)); + }; + printer.Connection.CommunicationStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); this.AddPageAction(nextButton); + this.AddPageAction(backButton); this.AddPageAction(connectButton); } @@ -114,7 +124,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerMessageOne.HAnchor = HAnchor.Stretch; printerMessageOne.Margin = elementMargin; - string printerMessageFourBeg = "Connect printer and power on".Localize(); + string printerMessageFourBeg = "Connect printer (make sure it is on)".Localize(); string printerMessageFourFull = string.Format("1.) {0}.", printerMessageFourBeg); TextWidget printerMessageFour = new TextWidget(printerMessageFourFull, 0, 0, 12); printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -132,16 +142,6 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections GuiWidget vSpacer = new GuiWidget(); vSpacer.VAnchor = VAnchor.Stretch; - var manualLink = new LinkLabel("Manual Configuration".Localize(), theme) - { - Margin = new BorderDouble(0, 5), - TextColor = theme.Colors.PrimaryTextColor - }; - manualLink.Click += (s, e) => UiThread.RunOnIdle(() => - { - DialogWindow.ChangeToPage(new SetupStepComPortManual(printer)); - }); - printerErrorMessage = new TextWidget("", 0, 0, 10) { AutoExpandBoundsToText = true, @@ -153,8 +153,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.AddChild(printerMessageOne); container.AddChild(printerMessageFour); container.AddChild(printerErrorMessage); + + var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "insert usb.png")); + removeImage.SetRecieveBlender(new BlenderPreMultBGRA()); + container.AddChild(new ImageWidget(removeImage) + { + HAnchor = HAnchor.Center, + Margin = new BorderDouble(0, 10), + }); + container.AddChild(vSpacer); - container.AddChild(manualLink); container.HAnchor = HAnchor.Stretch; return container; diff --git a/StaticData/Images/insert usb.png b/StaticData/Images/insert usb.png new file mode 100644 index 000000000..4723f611f Binary files /dev/null and b/StaticData/Images/insert usb.png differ diff --git a/StaticData/Images/remove usb.png b/StaticData/Images/remove usb.png new file mode 100644 index 000000000..d1bf3bc8c Binary files /dev/null and b/StaticData/Images/remove usb.png differ