diff --git a/CustomWidgets/PrintingWindow.cs b/CustomWidgets/PrintingWindow.cs index f4b26a87b..f7c778919 100644 --- a/CustomWidgets/PrintingWindow.cs +++ b/CustomWidgets/PrintingWindow.cs @@ -55,6 +55,8 @@ namespace MatterHackers.MatterControl.CustomWidgets private TextWidget targetTemp; private TextWidget actualTemp; + private ProgressBar progressBar; + public ExtruderStatusWidget(int extruderIndex) { this.extruderIndex = extruderIndex; @@ -68,32 +70,46 @@ namespace MatterHackers.MatterControl.CustomWidgets this.AddChild(extruderName); - this.AddChild(new ImageWidget(StaticData.Instance.LoadIcon(Path.Combine("Screensaver", "extruder_temp.png"))) + progressBar = new ProgressBar(200, 6) { - Margin = new BorderDouble(right: 8) - }); + FillColor = ActiveTheme.Instance.PrimaryAccentColor, + Margin = new BorderDouble(right: 10), + BorderColor = ActiveTheme.Instance.PrimaryAccentColor.AdjustLightness(1.5).GetAsRGBA_Bytes(), + VAnchor = VAnchor.ParentCenter, + //BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor.AdjustLightness(2.4).GetAsRGBA_Bytes() + + }; + this.AddChild(progressBar); actualTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) { - AutoExpandBoundsToText = true, VAnchor = VAnchor.ParentCenter, - Margin = new BorderDouble(right: 8) + Margin = new BorderDouble(right: 0), + Width = 60 }; this.AddChild(actualTemp); this.AddChild(new VerticalLine() { - BackgroundColor = new RGBA_Bytes(200, 200, 200, 30), + BackgroundColor = new RGBA_Bytes(200, 200, 200), Margin = new BorderDouble(right: 8) }); targetTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) { - AutoExpandBoundsToText = true, VAnchor = VAnchor.ParentCenter, - Margin = new BorderDouble(right: 8) + Margin = new BorderDouble(right: 8), + Width = 60 }; this.AddChild(targetTemp); + + UiThread.RunOnIdle(UpdateTemperatures); + } + + public RGBA_Bytes BorderColor + { + get { return progressBar.BorderColor; } + set { progressBar.BorderColor = value; } } public void UpdateTemperatures() @@ -101,6 +117,8 @@ namespace MatterHackers.MatterControl.CustomWidgets double targetValue = PrinterConnectionAndCommunication.Instance.GetTargetExtruderTemperature(extruderIndex); double actualValue = PrinterConnectionAndCommunication.Instance.GetActualExtruderTemperature(extruderIndex); + progressBar.RatioComplete = actualValue / targetValue; + this.actualTemp.Text = $"{actualValue:0.#}°"; this.targetTemp.Text = $"{targetValue:0.#}°"; } @@ -595,7 +613,9 @@ namespace MatterHackers.MatterControl.CustomWidgets int extruderCount = mockMode ? 3 : ActiveSliceSettings.Instance.GetValue(SettingsKey.extruder_count); - extruderStatusWidgets = Enumerable.Range(0, extruderCount).Select((i) => new ExtruderStatusWidget(i)).ToList(); + var borderColor = bodyContainer.BackgroundColor.AdjustLightness(1.5).GetAsRGBA_Bytes(); + + extruderStatusWidgets = Enumerable.Range(0, extruderCount).Select((i) => new ExtruderStatusWidget(i) { BorderColor = borderColor }).ToList(); if (extruderCount == 1) { diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 664c38a38..4640524df 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 664c38a385f297571c6646bf57d27b724c10b427 +Subproject commit 4640524dfb6df9073bab8269d297073cedfaf2b5