From ec2e36ab96cf22872735d15a3757069c1a0fdae1 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 14 May 2018 11:43:06 -0700 Subject: [PATCH 1/5] Use accent color on spinner to improve visibility --- ApplicationView/ApplicationController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index c57a1e0ee..774326d02 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -2163,7 +2163,12 @@ namespace MatterHackers.MatterControl systemWindow.AddChild(overlay); - var spinner = new LogoSpinner(overlay, rotateX: -0.05); + var mutedAccentColor = new Color(theme.Colors.PrimaryAccentColor, 185).OverlayOn(Color.White).ToColor(); + + var spinner = new LogoSpinner(overlay, rotateX: -0.05) + { + MeshColor = mutedAccentColor + }; progressPanel = new FlowLayoutWidget(FlowDirection.TopToBottom) { @@ -2184,7 +2189,7 @@ namespace MatterHackers.MatterControl progressPanel.AddChild(progressBar = new ProgressBar() { - FillColor = theme.Colors.PrimaryAccentColor, + FillColor = mutedAccentColor, BorderColor = theme.GetBorderColor(75), Height = 11, Width = 230, From e9cc60b81c976e87cffaf17e878af4537a634d63 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 14 May 2018 11:50:27 -0700 Subject: [PATCH 2/5] Simplify --- .../SetupStepComPortManual.cs | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/PrinterControls/PrinterConnections/SetupStepComPortManual.cs b/PrinterControls/PrinterConnections/SetupStepComPortManual.cs index fd06f08bb..169b99189 100644 --- a/PrinterControls/PrinterConnections/SetupStepComPortManual.cs +++ b/PrinterControls/PrinterConnections/SetupStepComPortManual.cs @@ -118,39 +118,47 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections private FlowLayoutWidget createComPortContainer() { - FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom); - container.Margin = new BorderDouble(0); - container.VAnchor = VAnchor.Stretch; + var container = new FlowLayoutWidget(FlowDirection.TopToBottom) + { + Margin = new BorderDouble(0), + VAnchor = VAnchor.Stretch + }; + BorderDouble elementMargin = new BorderDouble(top: 3); - string serialPortLabel = "Serial Port".Localize(); - string serialPortLabelFull = string.Format("{0}:", serialPortLabel); + var comPortLabel = new TextWidget("Serial Port".Localize() + ":", 0, 0, 12) + { + TextColor = ActiveTheme.Instance.PrimaryTextColor, + Margin = new BorderDouble(0, 0, 0, 10), + HAnchor = HAnchor.Stretch + }; - TextWidget comPortLabel = new TextWidget(serialPortLabelFull, 0, 0, 12); - comPortLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; - comPortLabel.Margin = new BorderDouble(0, 0, 0, 10); - comPortLabel.HAnchor = HAnchor.Stretch; - - FlowLayoutWidget serialPortContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); + var serialPortContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); CreateSerialPortControls(serialPortContainer, null); - FlowLayoutWidget comPortMessageContainer = new FlowLayoutWidget(); - comPortMessageContainer.Margin = elementMargin; - comPortMessageContainer.HAnchor = HAnchor.Stretch; + var comPortMessageContainer = new FlowLayoutWidget + { + Margin = elementMargin, + HAnchor = HAnchor.Stretch + }; - printerComPortError = new TextWidget("Currently available serial ports.".Localize(), 0, 0, 10); - printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor; - printerComPortError.AutoExpandBoundsToText = true; + printerComPortError = new TextWidget("Currently available serial ports.".Localize(), 0, 0, 10) + { + TextColor = ActiveTheme.Instance.PrimaryTextColor, + AutoExpandBoundsToText = true + }; printerComPortHelpLink = linkButtonFactory.Generate("What's this?".Localize()); printerComPortHelpLink.Margin = new BorderDouble(left: 5); printerComPortHelpLink.VAnchor = VAnchor.Bottom; printerComPortHelpLink.Click += (s, e) => printerComPortHelpMessage.Visible = !printerComPortHelpMessage.Visible; - printerComPortHelpMessage = new TextWidget("The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer.".Localize(), 0, 0, 10); - printerComPortHelpMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor; - printerComPortHelpMessage.Margin = new BorderDouble(top: 10); - printerComPortHelpMessage.Visible = false; + printerComPortHelpMessage = new TextWidget("The 'Serial Port' section lists all available serial\nports on your device. Changing which USB port the printer\nis connected to may change the associated serial port.\n\nTip: If you are uncertain, unplug/plug in your printer\nand hit refresh. The new port that appears should be\nyour printer.".Localize(), 0, 0, 10) + { + TextColor = ActiveTheme.Instance.PrimaryTextColor, + Margin = new BorderDouble(top: 10), + Visible = false + }; comPortMessageContainer.AddChild(printerComPortError); comPortMessageContainer.AddChild(printerComPortHelpLink); @@ -189,10 +197,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections protected void CreateSerialPortControls(FlowLayoutWidget comPortContainer, string activePrinterSerialPort) { int portIndex = 0; - string[] portsToCreate = FrostedSerialPort.GetPortNames(); // Add a radio button for each filtered port - foreach (string portName in portsToCreate) + foreach (string portName in FrostedSerialPort.GetPortNames()) { SerialPortIndexRadioButton comPortOption = createComPortOption(portName, activePrinterSerialPort == portName); if (comPortOption.Checked) @@ -220,23 +227,24 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections //If there are still no com ports show a message to that effect if (portIndex == 0) { - TextWidget comPortOption = new TextWidget("No COM ports available".Localize()); - comPortOption.Margin = new BorderDouble(3, 6, 5, 6); - comPortOption.TextColor = ActiveTheme.Instance.PrimaryTextColor; + var comPortOption = new TextWidget("No COM ports available".Localize()) + { + Margin = new BorderDouble(3, 6, 5, 6), + TextColor = ActiveTheme.Instance.PrimaryTextColor + }; comPortContainer.AddChild(comPortOption); } } private SerialPortIndexRadioButton createComPortOption(string portName, bool isActivePrinterPort) { - SerialPortIndexRadioButton comPortOption = new SerialPortIndexRadioButton(portName, portName) + return new SerialPortIndexRadioButton(portName, portName) { HAnchor = HAnchor.Left, Margin = new BorderDouble(3, 3, 5, 3), TextColor = ActiveTheme.Instance.PrimaryTextColor, Checked = isActivePrinterPort }; - return comPortOption; } private string GetSelectedSerialPort() From 7018f7823750d4aa2930aa17428b707664082ac1 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 14 May 2018 11:58:35 -0700 Subject: [PATCH 3/5] Remove non-theme aware Enabled code, use native Enabled behavior --- .../PrinterConnections/BaseConnectionWidget.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/PrinterControls/PrinterConnections/BaseConnectionWidget.cs b/PrinterControls/PrinterConnections/BaseConnectionWidget.cs index 1d3795779..d6554e61a 100644 --- a/PrinterControls/PrinterConnections/BaseConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/BaseConnectionWidget.cs @@ -22,18 +22,6 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections : base(label) { PortValue = value; - this.EnabledChanged += new EventHandler(onRadioButtonEnabledChanged); - } - - private void onRadioButtonEnabledChanged(object sender, EventArgs e) - { - if (this.Enabled) - { - this.TextColor = Color.White; - } - { - this.TextColor = Color.Gray; - } } } From 121b7324f032b2d96ddd1fe72c67b1206ed14d62 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 14 May 2018 12:21:57 -0700 Subject: [PATCH 4/5] Use theme colors --- CustomWidgets/ExportPrintItemPage.cs | 2 +- CustomWidgets/RadioImageWidget.cs | 4 ++-- CustomWidgets/RadioPanelWidget.cs | 4 ++-- PartPreviewWindow/PlusTab/ExplorerBar.cs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CustomWidgets/ExportPrintItemPage.cs b/CustomWidgets/ExportPrintItemPage.cs index dc5495f07..0ed42de9e 100644 --- a/CustomWidgets/ExportPrintItemPage.cs +++ b/CustomWidgets/ExportPrintItemPage.cs @@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl } // Create export button for each plugin - var pluginButton = new RadioButton(new RadioImageWidget(plugin.ButtonText, plugin.Icon)) + var pluginButton = new RadioButton(new RadioImageWidget(plugin.ButtonText, theme.Colors.PrimaryTextColor, plugin.Icon)) { HAnchor = HAnchor.Left, Margin = commonMargin, diff --git a/CustomWidgets/RadioImageWidget.cs b/CustomWidgets/RadioImageWidget.cs index d83486430..9a697029b 100644 --- a/CustomWidgets/RadioImageWidget.cs +++ b/CustomWidgets/RadioImageWidget.cs @@ -35,8 +35,8 @@ namespace MatterHackers.MatterControl { public class RadioImageWidget : RadioButtonViewText { - public RadioImageWidget(string label, ImageBuffer image) - : base(label) + public RadioImageWidget(string label, Color textColor, ImageBuffer image) + : base(label, textColor) { var imageWidget = new ImageWidget(image); this.AddChild(imageWidget, this.Children.IndexOf(labelTextWidget)); diff --git a/CustomWidgets/RadioPanelWidget.cs b/CustomWidgets/RadioPanelWidget.cs index 48647655d..2e3ee40e7 100644 --- a/CustomWidgets/RadioPanelWidget.cs +++ b/CustomWidgets/RadioPanelWidget.cs @@ -35,8 +35,8 @@ namespace MatterHackers.MatterControl { public class RadioPanelWidget : RadioButtonViewText { - public RadioPanelWidget(string label, string info, ImageBuffer image) - : base(label) + public RadioPanelWidget(string label, Color textColor, string info, ImageBuffer image) + : base(label, textColor) { radioCircle.Margin = new BorderDouble(4); radioCircle.VAnchor = VAnchor.Top; diff --git a/PartPreviewWindow/PlusTab/ExplorerBar.cs b/PartPreviewWindow/PlusTab/ExplorerBar.cs index 587083569..ffbdd5e05 100644 --- a/PartPreviewWindow/PlusTab/ExplorerBar.cs +++ b/PartPreviewWindow/PlusTab/ExplorerBar.cs @@ -191,14 +191,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab { if(ProfileManager.Instance.Profiles.Count > 0) { - toolbar.AddChild(new TextWidget("Select a printer to continue".Localize() + "...", pointSize: theme.DefaultFontSize) + toolbar.AddChild(new TextWidget("Select a printer to continue".Localize() + "...", textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) { Margin = 15 }); } else { - toolbar.AddChild(new TextWidget("Create a printer to continue".Localize() + "...", pointSize: theme.DefaultFontSize) + toolbar.AddChild(new TextWidget("Create a printer to continue".Localize() + "...", textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) { Margin = 15 }); From 80e738056a711290035f7d474dc276bb995b7f6b Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 14 May 2018 13:26:51 -0700 Subject: [PATCH 5/5] Latest agg-sharp --- Submodules/agg-sharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 2faecb966..840a2cdaf 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 2faecb96628ac12b327deb81805cc5fb2c9e9994 +Subproject commit 840a2cdaff743545260ea28e8b6541d3f8f75f5c