diff --git a/MatterControlLib/AboutPage/AboutPage.cs b/MatterControlLib/AboutPage/AboutPage.cs index ed9af54d3..51f5b2afc 100644 --- a/MatterControlLib/AboutPage/AboutPage.cs +++ b/MatterControlLib/AboutPage/AboutPage.cs @@ -73,8 +73,8 @@ namespace MatterHackers.MatterControl { HAnchor = HAnchor.Center | HAnchor.Fit }; - productTitle.AddChild(new TextWidget("MatterControl".Localize(), textColor: theme.Colors.PrimaryTextColor, pointSize: 20) { Margin = new BorderDouble(right: 3) }); - productTitle.AddChild(new TextWidget("TM".Localize(), textColor: theme.Colors.PrimaryTextColor, pointSize: 7) { VAnchor = VAnchor.Top }); + productTitle.AddChild(new TextWidget("MatterControl".Localize(), textColor: theme.TextColor, pointSize: 20) { Margin = new BorderDouble(right: 3) }); + productTitle.AddChild(new TextWidget("TM".Localize(), textColor: theme.TextColor, pointSize: 7) { VAnchor = VAnchor.Top }); altHeadingRow.AddChild(productInfo); productInfo.AddChild(productTitle); @@ -103,13 +103,13 @@ namespace MatterHackers.MatterControl }; productInfo.AddChild( - new TextWidget("Version".Localize() + " " + VersionInfo.Instance.BuildVersion, textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + new TextWidget("Version".Localize() + " " + VersionInfo.Instance.BuildVersion, textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Center }); productInfo.AddChild( - new TextWidget("Developed By".Localize() + ": " + "MatterHackers", textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + new TextWidget("Developed By".Localize() + ": " + "MatterHackers", textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Center }); @@ -118,7 +118,7 @@ namespace MatterHackers.MatterControl new WrappedTextWidget( "MatterControl is made possible by the team at MatterHackers and other open source software".Localize() + ":", pointSize: theme.DefaultFontSize, - textColor: theme.Colors.PrimaryTextColor) + textColor: theme.TextColor) { HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 15) @@ -182,7 +182,7 @@ namespace MatterHackers.MatterControl this.AddPageAction(feedbackButton, highlightFirstAction: false); ContentRow.AddChild( - new TextWidget("Copyright © 2018 MatterHackers, Inc.", textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + new TextWidget("Copyright © 2018 MatterHackers, Inc.", textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Center, }); @@ -190,7 +190,7 @@ namespace MatterHackers.MatterControl var siteLink = new LinkLabel("www.matterhackers.com", theme) { HAnchor = HAnchor.Center, - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; siteLink.Click += (s, e) => UiThread.RunOnIdle(() => { @@ -221,7 +221,7 @@ namespace MatterHackers.MatterControl { string content = AggContext.StaticData.ReadAllText(filePath); - this.AddChild(new WrappedTextWidget(content, theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + this.AddChild(new WrappedTextWidget(content, theme.DefaultFontSize, textColor: theme.TextColor) { HAnchor = HAnchor.Stretch }); diff --git a/MatterControlLib/AboutPage/CheckForUpdatesPage.cs b/MatterControlLib/AboutPage/CheckForUpdatesPage.cs index 7b7bfcbe0..6702173d0 100644 --- a/MatterControlLib/AboutPage/CheckForUpdatesPage.cs +++ b/MatterControlLib/AboutPage/CheckForUpdatesPage.cs @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl { HAnchor = HAnchor.Stretch, Margin = new BorderDouble(left: 5, bottom: 15, top: 20), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; contentPanel.AddChild(currentBuildInfo); @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl var feedLabel = new TextWidget("Update Channel".Localize(), pointSize: 12) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Center, Margin = new BorderDouble(left: 5) }; @@ -147,7 +147,7 @@ namespace MatterHackers.MatterControl additionalInfoContainer.AddChild( new WrappedTextWidget("Changing your update channel will change the version of MatterControl that you receive when updating".Localize() + ":") { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(bottom: 20) }); @@ -155,7 +155,7 @@ namespace MatterHackers.MatterControl additionalInfoContainer.AddChild( new WrappedTextWidget("Stable: The current release version of MatterControl (recommended)".Localize()) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(bottom: 10) }); @@ -163,7 +163,7 @@ namespace MatterHackers.MatterControl additionalInfoContainer.AddChild( new WrappedTextWidget("Beta: The release candidate version of MatterControl".Localize()) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(bottom: 10) }); @@ -171,7 +171,7 @@ namespace MatterHackers.MatterControl additionalInfoContainer.AddChild( new WrappedTextWidget("Alpha: The in development version of MatterControl".Localize()) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(bottom: 10) }); diff --git a/MatterControlLib/AboutPage/ContactFormPage.cs b/MatterControlLib/AboutPage/ContactFormPage.cs index 1948e614f..242579362 100644 --- a/MatterControlLib/AboutPage/ContactFormPage.cs +++ b/MatterControlLib/AboutPage/ContactFormPage.cs @@ -102,7 +102,7 @@ namespace MatterHackers.MatterControl.ContactForm { AutoExpandBoundsToText = true, Margin = new BorderDouble(0, 5), - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Left }; @@ -150,7 +150,7 @@ namespace MatterHackers.MatterControl.ContactForm labelContainer.AddChild(new TextWidget(labelText, pointSize: fontSize) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Bottom, HAnchor = HAnchor.Left, Margin = new BorderDouble(bottom: 2) diff --git a/MatterControlLib/AboutPage/UpdateControlView.cs b/MatterControlLib/AboutPage/UpdateControlView.cs index 731925d80..c0c7a7715 100644 --- a/MatterControlLib/AboutPage/UpdateControlView.cs +++ b/MatterControlLib/AboutPage/UpdateControlView.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl this.BackgroundColor = theme.MinimalShade; this.Padding = theme.ToolbarPadding.Clone(left: 8); - this.AddChild(updateStatusText = new TextWidget(string.Format(""), textColor: theme.Colors.PrimaryTextColor) + this.AddChild(updateStatusText = new TextWidget(string.Format(""), textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center diff --git a/MatterControlLib/ActionBar/TemperatureWidgetBase.cs b/MatterControlLib/ActionBar/TemperatureWidgetBase.cs index 066d8b303..3ddc022ae 100644 --- a/MatterControlLib/ActionBar/TemperatureWidgetBase.cs +++ b/MatterControlLib/ActionBar/TemperatureWidgetBase.cs @@ -86,17 +86,17 @@ namespace MatterHackers.MatterControl.ActionBar CurrentTempIndicator = new TextWidget(textValue, pointSize: 11) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Center, AutoExpandBoundsToText = true }; container.AddChild(CurrentTempIndicator); - container.AddChild(new TextWidget("/") { TextColor = theme.Colors.PrimaryTextColor }); + container.AddChild(new TextWidget("/") { TextColor = theme.TextColor }); goalTempIndicator = new TextWidget(textValue, pointSize: 11) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Center, AutoExpandBoundsToText = true }; @@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.ActionBar DirectionIndicator = new TextWidget(textValue, pointSize: 11) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Center, AutoExpandBoundsToText = true, Margin = new BorderDouble(left: 5) diff --git a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs index 1374eac83..aafef42ee 100644 --- a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs +++ b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs @@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.ActionBar break; } - moveButtonsContainer.AddChild(new TextWidget("mm", textColor: theme.Colors.PrimaryTextColor, pointSize: 8) + moveButtonsContainer.AddChild(new TextWidget("mm", textColor: theme.TextColor, pointSize: 8) { VAnchor = VAnchor.Center, Margin = new BorderDouble(3, 0) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index f642e158c..84c878b3e 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -180,8 +180,7 @@ namespace MatterHackers.MatterControl themeset = themeProvider.GetTheme("Modern-Dark"); } - DefaultThumbView.ThumbColor = new Color(themeset.Theme.Colors.PrimaryTextColor, 30); - ActiveTheme.Instance = themeset.Theme.Colors; + DefaultThumbView.ThumbColor = new Color(themeset.Theme.TextColor, 30); } public static ThemeConfig LoadTheme(string themeName) @@ -227,9 +226,6 @@ namespace MatterHackers.MatterControl { UserSettings.Instance.set(UserSettingsKey.ActiveThemeName, themeset.Name); - //Set new user selected Default - ActiveTheme.Instance = themeset.Theme.Colors; - // Explicitly fire ReloadAll in response to user interaction ApplicationController.Instance.ReloadAll(); }); @@ -814,7 +810,7 @@ namespace MatterHackers.MatterControl var theme = this.Theme; if (tab is GuiWidget guiWidget) { - guiWidget.Descendants().FirstOrDefault().FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); + guiWidget.Descendants().FirstOrDefault().FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.TextColor, 6).ToColor()); } } @@ -2217,7 +2213,7 @@ If you experience adhesion problems, please re-run leveling." { var hideGCodeWarningCheckBox = new CheckBox(doNotAskAgainMessage) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = this.Theme.TextColor, Margin = new BorderDouble(top: 6, left: 6), HAnchor = Agg.UI.HAnchor.Left }; @@ -2833,7 +2829,7 @@ If you experience adhesion problems, please re-run leveling." }; overlay.AddChild(progressPanel); - progressPanel.AddChild(statusText = new TextWidget("", textColor: AppContext.Theme.Colors.PrimaryTextColor) + progressPanel.AddChild(statusText = new TextWidget("", textColor: AppContext.Theme.TextColor) { MinimumSize = new Vector2(200, 30), HAnchor = HAnchor.Center, diff --git a/MatterControlLib/ApplicationView/BrandMenuButton.cs b/MatterControlLib/ApplicationView/BrandMenuButton.cs index 2f8aedaf9..c4caa9b96 100644 --- a/MatterControlLib/ApplicationView/BrandMenuButton.cs +++ b/MatterControlLib/ApplicationView/BrandMenuButton.cs @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl Selectable = false }); - row.AddChild(new TextWidget(ApplicationController.Instance.ShortProductName, textColor: theme.Colors.PrimaryTextColor) + row.AddChild(new TextWidget(ApplicationController.Instance.ShortProductName, textColor: theme.TextColor) { VAnchor = VAnchor.Center }); @@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl VAnchor = VAnchor.Fit, }; - themeRow.AddChild(new TextWidget("Theme".Localize(), pointSize: menuTheme.DefaultFontSize, textColor: menuTheme.Colors.PrimaryTextColor) + themeRow.AddChild(new TextWidget("Theme".Localize(), pointSize: menuTheme.DefaultFontSize, textColor: menuTheme.TextColor) { VAnchor = VAnchor.Center, }); diff --git a/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs b/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs deleted file mode 100644 index b76ccc1c0..000000000 --- a/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (c) 2018, Kevin Pope, John Lewin -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using MatterHackers.MatterControl; - -namespace MatterHackers.Agg.UI -{ - public static class ActiveTheme - { - public static RootedObjectEventHandler ThemeChanged = new RootedObjectEventHandler(); - - private static IThemeColors activeTheme; - - static ActiveTheme() - { - Color accentColor; - - (activeTheme, accentColor) = ThemeColors.Create(new Color(172, 25, 61) /* Classic Red */); - } - - public static IThemeColors Instance - { - get => activeTheme; - set - { - if (value != activeTheme) - { - activeTheme = value; - OnThemeChanged(); - } - } - } - - private static void OnThemeChanged() - { - ThemeChanged?.CallEvents(null, null); - } - } -} \ No newline at end of file diff --git a/MatterControlLib/ApplicationView/Themes/IThemeColors.cs b/MatterControlLib/ApplicationView/Themes/IThemeColors.cs deleted file mode 100644 index fe0fb8bb6..000000000 --- a/MatterControlLib/ApplicationView/Themes/IThemeColors.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (c) 2016, Kevin Pope, John Lewin -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using System; - -namespace MatterHackers.Agg.UI -{ - public interface IThemeColors - { - Color PrimaryTextColor { get; } - } -} \ No newline at end of file diff --git a/MatterControlLib/ApplicationView/Themes/ThemeColors.cs b/MatterControlLib/ApplicationView/Themes/ThemeColors.cs deleted file mode 100644 index 4818d7c9f..000000000 --- a/MatterControlLib/ApplicationView/Themes/ThemeColors.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (c) 2016, Kevin Pope, John Lewin -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using System; - -namespace MatterHackers.Agg.UI -{ - public class ThemeColors: IThemeColors - { - public Color PrimaryTextColor { get; set; } - - public static (ThemeColors ThemeColors, Color AccentColor) Create(Color accentColor, bool darkTheme = true) - { - var primaryBackgroundColor = new Color(darkTheme ? "#444" : "#D0D0D0"); - - return ( - new ThemeColors - { - PrimaryTextColor = new Color(darkTheme ? "#FFFFFF" : "#222"), - }, - GetAdjustedAccentColor(accentColor, primaryBackgroundColor)); - } - - public static Color GetAdjustedAccentColor(Color accentColor, Color backgroundColor) - { - return accentColor.WithContrast(backgroundColor).ToColor(); - } - } -} \ No newline at end of file diff --git a/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs b/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs index 24926faf9..5cc7242b8 100644 --- a/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs +++ b/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs @@ -138,7 +138,8 @@ namespace MatterHackers.MatterControl } } - public ThemeColors Colors { get; set; } = new ThemeColors(); + public Color TextColor { get; set; } = Color.Black; + public PresetColors PresetColors { get; set; } = new PresetColors(); public bool IsDarkTheme { get; set; } @@ -155,7 +156,7 @@ namespace MatterHackers.MatterControl public TextWidget CreateHeading(string text) { - return new TextWidget(text, pointSize: this.H1PointSize, textColor: this.Colors.PrimaryTextColor, bold: true) + return new TextWidget(text, pointSize: this.H1PointSize, textColor: this.TextColor, bold: true) { Margin = new BorderDouble(0, 5) }; @@ -241,7 +242,7 @@ namespace MatterHackers.MatterControl this.GeneratingThumbnailIcon = AggContext.StaticData.LoadIcon("building_thumbnail_40x40.png", 40, 40, this.InvertIcons); - DefaultThumbView.ThumbColor = new Color(this.Colors.PrimaryTextColor, 30); + DefaultThumbView.ThumbColor = new Color(this.TextColor, 30); } public JogControls.MoveButton CreateMoveButton(PrinterConfig printer, string label, PrinterConnection.Axis axis, double movementFeedRate, bool levelingButtons = false) @@ -438,7 +439,7 @@ namespace MatterHackers.MatterControl { double scrollBarWidth = 10; - wordOptionContainer.AddChild(new TextWidget(header, textColor: this.Colors.PrimaryTextColor) + wordOptionContainer.AddChild(new TextWidget(header, textColor: this.TextColor) { Margin = new BorderDouble(10, 3, 3, 5), HAnchor = HAnchor.Left diff --git a/MatterControlLib/ApplicationView/Themes/ThemeSet.cs b/MatterControlLib/ApplicationView/Themes/ThemeSet.cs index af33d8e7e..b304b3f4d 100644 --- a/MatterControlLib/ApplicationView/Themes/ThemeSet.cs +++ b/MatterControlLib/ApplicationView/Themes/ThemeSet.cs @@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl { public class ThemeSet { - public static int LatestSchemeVersion { get; } = 20181030; + public static int LatestSchemeVersion { get; } = 20181103; /// /// The identifier to use for this combination of accent colors, theme and menu theme diff --git a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs index e24ae6fdd..8b286844e 100644 --- a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs +++ b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs @@ -160,7 +160,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage name = themeset.ThemesetID.Replace("-", " "); } - previewColumn.AddChild(new TextWidget(name, pointSize: theme.FontSize7, textColor: theme.Colors.PrimaryTextColor) + previewColumn.AddChild(new TextWidget(name, pointSize: theme.FontSize7, textColor: theme.TextColor) { HAnchor = HAnchor.Left, Margin = new BorderDouble(12, 2) diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/LoadFilamentWizard.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/LoadFilamentWizard.cs index 1972699a2..48abb9e14 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/LoadFilamentWizard.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/LoadFilamentWizard.cs @@ -189,11 +189,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling var progressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { FillColor = theme.PrimaryAccentColor, - BorderColor = ActiveTheme.Instance.PrimaryTextColor, + BorderColor = theme.TextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 10), }; - var progressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + var progressBarText = new TextWidget("", pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 0, 0), diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/PrinterSetupWizardPage.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/PrinterSetupWizardPage.cs index d0137b856..297e5fe49 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/PrinterSetupWizardPage.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/PrinterSetupWizardPage.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl return new WrappedTextWidget(text) { Margin = new BorderDouble(left: 10, top: 10), - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch }; } diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs index 43a91010e..de4314edc 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs @@ -69,7 +69,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling zButtonsAndInfo.AddChild(new GuiWidget(15, 10)); //textFields - TextWidget zPosition = new TextWidget("Z: 0.0 ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor) + TextWidget zPosition = new TextWidget("Z: 0.0 ", pointSize: 12, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(10, 0), diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs index a093a0491..91067b231 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling }; // put in bar name - ContentRow.AddChild(new TextWidget("Hotend Temperature:".Localize(), pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + ContentRow.AddChild(new TextWidget("Hotend Temperature:".Localize(), pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 5, 5), @@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling hotEndProgressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { FillColor = theme.PrimaryAccentColor, - BorderColor = ActiveTheme.Instance.PrimaryTextColor, + BorderColor = theme.TextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 0), VAnchor = VAnchor.Center @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling hotEndProgressHolder.AddChild(hotEndProgressBar); // put in the status - hotEndProgressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + hotEndProgressBarText = new TextWidget("", pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 5, 5), @@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling hotEndProgressHolder.AddChild(hotEndProgressBarText); // message to show when done - hotEndDoneText = new TextWidget("Done!", textColor: ActiveTheme.Instance.PrimaryTextColor) + hotEndDoneText = new TextWidget("Done!", textColor: theme.TextColor) { AutoExpandBoundsToText = true, Visible = false, @@ -110,7 +110,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling }; // put in bar name - ContentRow.AddChild(new TextWidget("Bed Temperature:".Localize(), pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + ContentRow.AddChild(new TextWidget("Bed Temperature:".Localize(), pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 5, 5), @@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling bedProgressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { FillColor = theme.PrimaryAccentColor, - BorderColor = ActiveTheme.Instance.PrimaryTextColor, + BorderColor = theme.TextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 0), VAnchor = VAnchor.Center @@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling bedProgressHolder.AddChild(bedProgressBar); // put in status - bedProgressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + bedProgressBarText = new TextWidget("", pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 0, 0), @@ -137,7 +137,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling bedProgressHolder.AddChild(bedProgressBarText); // message to show when done - bedDoneText = new TextWidget("Done!", textColor: ActiveTheme.Instance.PrimaryTextColor) + bedDoneText = new TextWidget("Done!", textColor: theme.TextColor) { AutoExpandBoundsToText = true, Visible = false, diff --git a/MatterControlLib/ConfigurationPage/RunningMacroPage.cs b/MatterControlLib/ConfigurationPage/RunningMacroPage.cs index b56572a9a..0a26ab0ca 100644 --- a/MatterControlLib/ConfigurationPage/RunningMacroPage.cs +++ b/MatterControlLib/ConfigurationPage/RunningMacroPage.cs @@ -96,11 +96,11 @@ namespace MatterHackers.MatterControl.PrinterControls progressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { FillColor = theme.PrimaryAccentColor, - BorderColor = ActiveTheme.Instance.PrimaryTextColor, + BorderColor = theme.TextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 10), }; - progressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + progressBarText = new TextWidget("", pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 0, 0), diff --git a/MatterControlLib/ControlElements/MHDropDownList.cs b/MatterControlLib/ControlElements/MHDropDownList.cs index 8a28316ba..de2b3c882 100644 --- a/MatterControlLib/ControlElements/MHDropDownList.cs +++ b/MatterControlLib/ControlElements/MHDropDownList.cs @@ -43,9 +43,9 @@ namespace MatterHackers.MatterControl var menuTheme = AppContext.MenuTheme; this.MenuItemsBackgroundColor = menuTheme.ActiveTabColor; - this.MenuItemsTextColor = menuTheme.Colors.PrimaryTextColor; + this.MenuItemsTextColor = menuTheme.TextColor; this.MenuItemsBackgroundHoverColor = menuTheme.AccentMimimalOverlay; - this.MenuItemsTextHoverColor = menuTheme.Colors.PrimaryTextColor; + this.MenuItemsTextHoverColor = menuTheme.TextColor; this.MenuItemsBorderColor = menuTheme.DropList.Open.BackgroundColor; this.theme = theme; diff --git a/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs b/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs index 09bbdad61..997aff1ea 100644 --- a/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs +++ b/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs @@ -78,7 +78,7 @@ namespace MatterHackers.MatterControl responseCallback = callback; unwrappedMessage = message; - ContentRow.AddChild(messageContainer = new TextWidget(message, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12 * DeviceScale) + ContentRow.AddChild(messageContainer = new TextWidget(message, textColor: theme.TextColor, pointSize: 12 * DeviceScale) { AutoExpandBoundsToText = true, HAnchor = HAnchor.Left @@ -164,4 +164,3 @@ namespace MatterHackers.MatterControl } } - \ No newline at end of file diff --git a/MatterControlLib/CustomWidgets/DockingTabControl.cs b/MatterControlLib/CustomWidgets/DockingTabControl.cs index 76e896dab..f35e82700 100644 --- a/MatterControlLib/CustomWidgets/DockingTabControl.cs +++ b/MatterControlLib/CustomWidgets/DockingTabControl.cs @@ -344,7 +344,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }); buttonView.AfterDraw += (s, e) => { - e.Graphics2D.Render(rotatedLabel, theme.Colors.PrimaryTextColor); + e.Graphics2D.Render(rotatedLabel, theme.TextColor); }; } @@ -380,7 +380,7 @@ namespace MatterHackers.MatterControl.CustomWidgets BackgroundColor = theme.TabBarBackground, }; - titleBar.AddChild(new TextWidget(title, textColor: theme.Colors.PrimaryTextColor) + titleBar.AddChild(new TextWidget(title, textColor: theme.TextColor) { Margin = new BorderDouble(left: 8), VAnchor = VAnchor.Center diff --git a/MatterControlLib/CustomWidgets/EditableNumberDisplay.cs b/MatterControlLib/CustomWidgets/EditableNumberDisplay.cs index 106dfac47..c6c9c2940 100644 --- a/MatterControlLib/CustomWidgets/EditableNumberDisplay.cs +++ b/MatterControlLib/CustomWidgets/EditableNumberDisplay.cs @@ -33,7 +33,7 @@ namespace MatterHackers.MatterControl } public EditableNumberDisplay(double startingValue, string largestPossibleValue, ThemeConfig theme) - : this(startingValue, largestPossibleValue, ActiveTheme.Instance.PrimaryTextColor, theme) + : this(startingValue, largestPossibleValue, theme.TextColor, theme) { } diff --git a/MatterControlLib/CustomWidgets/ExportPrintItemPage.cs b/MatterControlLib/CustomWidgets/ExportPrintItemPage.cs index 7a70f054c..99f715a44 100644 --- a/MatterControlLib/CustomWidgets/ExportPrintItemPage.cs +++ b/MatterControlLib/CustomWidgets/ExportPrintItemPage.cs @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl } // Create export button for each plugin - var pluginButton = new RadioButton(new RadioImageWidget(plugin.ButtonText, theme.Colors.PrimaryTextColor, plugin.Icon)) + var pluginButton = new RadioButton(new RadioImageWidget(plugin.ButtonText, theme.TextColor, plugin.Icon)) { HAnchor = HAnchor.Left, Margin = commonMargin, @@ -117,7 +117,7 @@ namespace MatterHackers.MatterControl if (AggContext.OperatingSystem == OSType.Windows || AggContext.OperatingSystem == OSType.X11) { - showInFolderAfterSave = new CheckBox("Show file in folder after save".Localize(), ActiveTheme.Instance.PrimaryTextColor, 10) + showInFolderAfterSave = new CheckBox("Show file in folder after save".Localize(), theme.TextColor, 10) { HAnchor = HAnchor.Left, Cursor = Cursors.Hand diff --git a/MatterControlLib/CustomWidgets/HelpArticleHeader.cs b/MatterControlLib/CustomWidgets/HelpArticleHeader.cs index c1ee53067..e553d92fd 100644 --- a/MatterControlLib/CustomWidgets/HelpArticleHeader.cs +++ b/MatterControlLib/CustomWidgets/HelpArticleHeader.cs @@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.HAnchor = HAnchor.Stretch; this.VAnchor = VAnchor.Fit; - var titleText = new TextWidget(helpArticle.Name, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: pointSize > 0 ? pointSize : theme.DefaultFontSize, bold: boldFont) + var titleText = new TextWidget(helpArticle.Name, textColor: theme.TextColor, pointSize: pointSize > 0 ? pointSize : theme.DefaultFontSize, bold: boldFont) { VAnchor = VAnchor.Center, AutoExpandBoundsToText = true, diff --git a/MatterControlLib/CustomWidgets/InlineStringEdit.cs b/MatterControlLib/CustomWidgets/InlineStringEdit.cs index 591b7f91a..43672eae5 100644 --- a/MatterControlLib/CustomWidgets/InlineStringEdit.cs +++ b/MatterControlLib/CustomWidgets/InlineStringEdit.cs @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.HAnchor = HAnchor.Stretch; this.VAnchor = VAnchor.Fit; - titleText = new TextWidget(stringValue, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: theme.DefaultFontSize, bold: boldFont) + titleText = new TextWidget(stringValue, textColor: theme.TextColor, pointSize: theme.DefaultFontSize, bold: boldFont) { VAnchor = VAnchor.Center, AutoExpandBoundsToText = true, diff --git a/MatterControlLib/CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs b/MatterControlLib/CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs index a3c8db6e3..c3b277b4b 100644 --- a/MatterControlLib/CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs +++ b/MatterControlLib/CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.CustomWidgets Name = "Bread Crumb Button " + listView.ActiveContainer.Name, VAnchor = VAnchor.Center, Margin = theme.ButtonSpacing, - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; this.AddChild(containerButton); } @@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl.CustomWidgets if (!firstItem) { // Add path separator - this.AddChild(new TextWidget("/", pointSize: theme.DefaultFontSize + 1, textColor: ActiveTheme.Instance.PrimaryTextColor) + this.AddChild(new TextWidget("/", pointSize: theme.DefaultFontSize + 1, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = extraSpacing.Clone(top: 2) @@ -113,7 +113,7 @@ namespace MatterHackers.MatterControl.CustomWidgets Name = "Bread Crumb Button " + container.Name, VAnchor = VAnchor.Center, Margin = theme.ButtonSpacing.Clone(top: 1), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; containerButton.Click += (s, e) => { @@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.CustomWidgets // lets take out the > and put in a ... this.RemoveChild(1); - var separator = new TextWidget("...", textColor: ActiveTheme.Instance.PrimaryTextColor) + var separator = new TextWidget("...", textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(right: 5) diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs b/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs index ea4db7d94..b0e912944 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs @@ -66,7 +66,7 @@ namespace MatterHackers.MatterControl.CustomWidgets primaryAccentColor = theme.PrimaryAccentColor; primaryAccentShade = theme.PrimaryAccentColor.WithLightnessAdjustment(0.7).ToColor(); - percentCompleteWidget = new TextWidget("", pointSize: 22, textColor: ActiveTheme.Instance.PrimaryTextColor) + percentCompleteWidget = new TextWidget("", pointSize: 22, textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.CustomWidgets CompletedRatio = 0; - layerCountWidget = new TextWidget("", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor) + layerCountWidget = new TextWidget("", pointSize: 12, textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.AddChild(percentCompleteWidget); this.AddChild(layerCountWidget); - borderColor = ActiveTheme.Instance.PrimaryTextColor; + borderColor = theme.TextColor; borderColor.Alpha0To1 = 0.3f; } diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs b/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs index 2e83981b6..1210d00f9 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs @@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.CustomWidgets public TemperatureStatusWidget(PrinterConfig printer, string dispalyName, ThemeConfig theme) { this.printer = printer; - var extruderName = new TextWidget(dispalyName, pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) + var extruderName = new TextWidget(dispalyName, pointSize: fontSize, textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, @@ -59,12 +59,12 @@ namespace MatterHackers.MatterControl.CustomWidgets FillColor = theme.PrimaryAccentColor, Margin = new BorderDouble(right: 10), BorderColor = Color.Transparent, - BackgroundColor = new Color(ActiveTheme.Instance.PrimaryTextColor, 50), + BackgroundColor = new Color(theme.TextColor, 50), VAnchor = VAnchor.Center, }; this.AddChild(progressBar); - actualTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) + actualTemp = new TextWidget("", pointSize: fontSize, textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, @@ -75,11 +75,11 @@ namespace MatterHackers.MatterControl.CustomWidgets this.AddChild(new VerticalLine() { - BackgroundColor = ActiveTheme.Instance.PrimaryTextColor, + BackgroundColor = theme.TextColor, Margin = new BorderDouble(8, 0) }); - targetTemp = new TextWidget("", pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) + targetTemp = new TextWidget("", pointSize: fontSize, textColor: theme.TextColor) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, diff --git a/MatterControlLib/CustomWidgets/SavePartsSheetFeedbackWindow.cs b/MatterControlLib/CustomWidgets/SavePartsSheetFeedbackWindow.cs index 037c7b2c2..ffe39f051 100644 --- a/MatterControlLib/CustomWidgets/SavePartsSheetFeedbackWindow.cs +++ b/MatterControlLib/CustomWidgets/SavePartsSheetFeedbackWindow.cs @@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl private TextWidget CreateNextLine(string startText) { - return new TextWidget(startText, textColor: ActiveTheme.Instance.PrimaryTextColor) + return new TextWidget(startText, textColor: AppContext.Theme.TextColor) { Margin = new BorderDouble(0, 2), HAnchor = Agg.UI.HAnchor.Left, diff --git a/MatterControlLib/CustomWidgets/SimpleButton.cs b/MatterControlLib/CustomWidgets/SimpleButton.cs index 020b4d3df..3f5e40958 100644 --- a/MatterControlLib/CustomWidgets/SimpleButton.cs +++ b/MatterControlLib/CustomWidgets/SimpleButton.cs @@ -410,11 +410,11 @@ namespace MatterHackers.MatterControl.CustomWidgets this.VAnchor = VAnchor.Absolute | VAnchor.Center; this.Height = theme.ButtonHeight; this.Padding = theme.TextButtonPadding; - this.TextColor = theme.Colors.PrimaryTextColor; + this.TextColor = theme.TextColor; var textSize = (pointSize != -1) ? pointSize : theme.DefaultFontSize; - this.AddChild(textWidget = new TextWidget(text, pointSize: textSize, textColor: theme.Colors.PrimaryTextColor) + this.AddChild(textWidget = new TextWidget(text, pointSize: textSize, textColor: theme.TextColor) { HAnchor = HAnchor.Center, VAnchor = VAnchor.Center, @@ -472,7 +472,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }; this.AddChild(textContainer); - textContainer.AddChild(textWidget = new TextWidget(text, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor)); + textContainer.AddChild(textWidget = new TextWidget(text, pointSize: theme.DefaultFontSize, textColor: theme.TextColor)); } public ImageWidget ImageWidget { get; } diff --git a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs index b95e7991c..64beb380a 100644 --- a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs +++ b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs @@ -102,7 +102,7 @@ namespace MatterHackers.Agg.UI VAnchor = VAnchor.Center }); - titleBarRow.ActionArea.AddChild(new TextWidget(systemWindow.Title ?? "", pointSize: theme.DefaultFontSize - 1, textColor: theme.Colors.PrimaryTextColor) + titleBarRow.ActionArea.AddChild(new TextWidget(systemWindow.Title ?? "", pointSize: theme.DefaultFontSize - 1, textColor: theme.TextColor) { VAnchor = VAnchor.Center, }); diff --git a/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs b/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs index dfefbc6c3..e0156dfd9 100644 --- a/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs +++ b/MatterControlLib/CustomWidgets/TreeView/TreeNode.cs @@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }); }; - this.HighlightRegion.AddChild(textWidget = new TextWidget(this.Text, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + this.HighlightRegion.AddChild(textWidget = new TextWidget(this.Text, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Selectable = false, AutoExpandBoundsToText = true, diff --git a/MatterControlLib/DesignTools/PublicPropertyEditor.cs b/MatterControlLib/DesignTools/PublicPropertyEditor.cs index bebd9d6d0..4aeb6e793 100644 --- a/MatterControlLib/DesignTools/PublicPropertyEditor.cs +++ b/MatterControlLib/DesignTools/PublicPropertyEditor.cs @@ -197,7 +197,7 @@ namespace MatterHackers.MatterControl.DesignTools ToolTipText = toolTipText }; - var label = new TextWidget(labelText + ":", pointSize: 11, textColor: ActiveTheme.Instance.PrimaryTextColor) + var label = new TextWidget(labelText + ":", pointSize: 11, textColor: AppContext.Theme.TextColor) { Margin = new BorderDouble(0, 0, 3, 0), VAnchor = VAnchor.Center @@ -241,7 +241,7 @@ namespace MatterHackers.MatterControl.DesignTools ToolTipText = toolTipText }; - var label = new TextWidget(labelText + ":", pointSize: 11, textColor: ActiveTheme.Instance.PrimaryTextColor) + var label = new TextWidget(labelText + ":", pointSize: 11, textColor: AppContext.Theme.TextColor) { Margin = new BorderDouble(0, 3, 0, 0), HAnchor = HAnchor.Left @@ -655,7 +655,7 @@ namespace MatterHackers.MatterControl.DesignTools var radioButton = new RadioButton(string.IsNullOrWhiteSpace(child.Name) ? $"{itemIndex}" : $"{child.Name}") { Checked = childSelector.Contains(child.ID), - TextColor = ActiveTheme.Instance.PrimaryTextColor + TextColor = theme.TextColor }; radioSiblings.Add(radioButton); radioButton.SiblingRadioButtonList = radioSiblings; @@ -666,7 +666,7 @@ namespace MatterHackers.MatterControl.DesignTools selectWidget = new CheckBox(string.IsNullOrWhiteSpace(child.Name) ? $"{itemIndex}" : $"{child.Name}") { Checked = childSelector.Contains(child.ID), - TextColor = ActiveTheme.Instance.PrimaryTextColor + TextColor = theme.TextColor }; } diff --git a/MatterControlLib/EeProm/EePromMarlinWindow.cs b/MatterControlLib/EeProm/EePromMarlinWindow.cs index 567c5a592..082bad86f 100644 --- a/MatterControlLib/EeProm/EePromMarlinWindow.cs +++ b/MatterControlLib/EeProm/EePromMarlinWindow.cs @@ -287,7 +287,7 @@ namespace MatterHackers.MatterControl.EeProm private GuiWidget CreateTextField(string label) { - var textWidget = new TextWidget(label, pointSize: theme.FontSize10, textColor: ActiveTheme.Instance.PrimaryTextColor) + var textWidget = new TextWidget(label, pointSize: theme.FontSize10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, HAnchor = HAnchor.Right @@ -311,7 +311,7 @@ namespace MatterHackers.MatterControl.EeProm HAnchor = HAnchor.Stretch }; - var labelWidget = new TextWidget(label, pointSize: theme.FontSize10, textColor: ActiveTheme.Instance.PrimaryTextColor); + var labelWidget = new TextWidget(label, pointSize: theme.FontSize10, textColor: theme.TextColor); maxWidthOfLeftStuff = Math.Max(maxWidthOfLeftStuff, labelWidget.Width); var holder = new GuiWidget(labelWidget.Width, labelWidget.Height) diff --git a/MatterControlLib/EeProm/EePromRepetierWindow.cs b/MatterControlLib/EeProm/EePromRepetierWindow.cs index 8325f743a..2e36a8830 100644 --- a/MatterControlLib/EeProm/EePromRepetierWindow.cs +++ b/MatterControlLib/EeProm/EePromRepetierWindow.cs @@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl.EeProm CreateSpacer(row); - row.AddChild(new TextWidget("Value".Localize(), pointSize: theme.FontSize10, textColor: ActiveTheme.Instance.PrimaryTextColor) + row.AddChild(new TextWidget("Value".Localize(), pointSize: theme.FontSize10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(left: 5, right: 60) @@ -319,7 +319,7 @@ namespace MatterHackers.MatterControl.EeProm private GuiWidget AddDescription(string description) { var holder = new GuiWidget(340, 40); - holder.AddChild(new TextWidget(description, pointSize: theme.DefaultFontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) + holder.AddChild(new TextWidget(description, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { VAnchor = VAnchor.Center }); diff --git a/MatterControlLib/Library/Export/GCodeExport.cs b/MatterControlLib/Library/Export/GCodeExport.cs index 93f936879..631bb4ed0 100644 --- a/MatterControlLib/Library/Export/GCodeExport.cs +++ b/MatterControlLib/Library/Export/GCodeExport.cs @@ -84,7 +84,9 @@ namespace MatterHackers.MatterControl.Library.Export Margin = new BorderDouble(left: 40, bottom: 10), }; - var spiralVaseCheckbox = new CheckBox("Spiral Vase".Localize(), ActiveTheme.Instance.PrimaryTextColor, 10) + var theme = AppContext.Theme; + + var spiralVaseCheckbox = new CheckBox("Spiral Vase".Localize(), theme.TextColor, 10) { Checked = false, Cursor = Cursors.Hand, @@ -98,7 +100,7 @@ namespace MatterHackers.MatterControl.Library.Export // If print leveling is enabled then add in a check box 'Apply Leveling During Export' and default checked. if (printer.Settings.GetValue(SettingsKey.print_leveling_enabled)) { - var levelingCheckbox = new CheckBox("Apply leveling to G-Code during export".Localize(), ActiveTheme.Instance.PrimaryTextColor, 10) + var levelingCheckbox = new CheckBox("Apply leveling to G-Code during export".Localize(), theme.TextColor, 10) { Checked = true, Cursor = Cursors.Hand, diff --git a/MatterControlLib/Library/Widgets/ExpandCheckboxButton.cs b/MatterControlLib/Library/Widgets/ExpandCheckboxButton.cs index 217097548..6c7280a9b 100644 --- a/MatterControlLib/Library/Widgets/ExpandCheckboxButton.cs +++ b/MatterControlLib/Library/Widgets/ExpandCheckboxButton.cs @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.CustomWidgets _expandable = expandable; - this.AddChild(textWidget = new TextWidget(text, pointSize: pointSize, textColor: theme.Colors.PrimaryTextColor) + this.AddChild(textWidget = new TextWidget(text, pointSize: pointSize, textColor: theme.TextColor) { VAnchor = VAnchor.Center, AutoExpandBoundsToText = true diff --git a/MatterControlLib/Library/Widgets/HardwarePage/PrinterDetails.cs b/MatterControlLib/Library/Widgets/HardwarePage/PrinterDetails.cs index 9960e645d..a9381bfbb 100644 --- a/MatterControlLib/Library/Widgets/HardwarePage/PrinterDetails.cs +++ b/MatterControlLib/Library/Widgets/HardwarePage/PrinterDetails.cs @@ -325,7 +325,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage row.AddChild( new TextWidget( text, - textColor: theme.Colors.PrimaryTextColor, + textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { VAnchor = VAnchor.Center @@ -344,7 +344,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage row.AddChild( new TextWidget( text, - textColor: theme.Colors.PrimaryTextColor, + textColor: theme.TextColor, pointSize: theme.DefaultFontSize)); return row; diff --git a/MatterControlLib/Library/Widgets/ListView/IconListView.cs b/MatterControlLib/Library/Widgets/ListView/IconListView.cs index 0c51c4cb5..fc6e818ed 100644 --- a/MatterControlLib/Library/Widgets/ListView/IconListView.cs +++ b/MatterControlLib/Library/Widgets/ListView/IconListView.cs @@ -310,7 +310,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }; container.AddChild(imageWidget); - text = new TextWidget(item.Model.Name, 0, 0, 9, textColor: ActiveTheme.Instance.PrimaryTextColor) + text = new TextWidget(item.Model.Name, 0, 0, 9, textColor: theme.TextColor) { AutoExpandBoundsToText = false, EllipsisIfClipped = true, diff --git a/MatterControlLib/Library/Widgets/ListView/RowListView.cs b/MatterControlLib/Library/Widgets/ListView/RowListView.cs index 384f5af15..0b50aa5aa 100644 --- a/MatterControlLib/Library/Widgets/ListView/RowListView.cs +++ b/MatterControlLib/Library/Widgets/ListView/RowListView.cs @@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl.CustomWidgets Name = "List Item Thumbnail", }); - row.AddChild(new TextWidget(listViewItem.Model.Name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + row.AddChild(new TextWidget(listViewItem.Model.Name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(10, 0) diff --git a/MatterControlLib/Library/Widgets/StorePage/ExploreItem.cs b/MatterControlLib/Library/Widgets/StorePage/ExploreItem.cs index 2be940a7f..24e7c1e45 100644 --- a/MatterControlLib/Library/Widgets/StorePage/ExploreItem.cs +++ b/MatterControlLib/Library/Widgets/StorePage/ExploreItem.cs @@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab whiteBackground.AddChild(imageWidget); } - var wrappedText = new WrappedTextWidget(item.title, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: theme.DefaultFontSize) + var wrappedText = new WrappedTextWidget(item.title, textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { Selectable = false, VAnchor = VAnchor.Center | VAnchor.Fit, diff --git a/MatterControlLib/Library/Widgets/StorePage/ExplorePanel.cs b/MatterControlLib/Library/Widgets/StorePage/ExplorePanel.cs index cfc5b7772..9eb265ba2 100644 --- a/MatterControlLib/Library/Widgets/StorePage/ExplorePanel.cs +++ b/MatterControlLib/Library/Widgets/StorePage/ExplorePanel.cs @@ -178,7 +178,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab graphics2D.DrawString(content.text, image.Width/2, image.Height/2 + printer.TypeFaceStyle.EmSizeInPixels / 2, goalPointSize, Justification.Center, Baseline.BoundsTop, - theme.Colors.PrimaryTextColor); + theme.TextColor); if (content.link != null) { diff --git a/MatterControlLib/Library/Widgets/StorePage/ExploreSection.cs b/MatterControlLib/Library/Widgets/StorePage/ExploreSection.cs index f45d46144..fdfb876a5 100644 --- a/MatterControlLib/Library/Widgets/StorePage/ExploreSection.cs +++ b/MatterControlLib/Library/Widgets/StorePage/ExploreSection.cs @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab if (content.group_title != null) { - this.AddChild(new TextWidget(content.group_title, pointSize: theme.H1PointSize, textColor: ActiveTheme.Instance.PrimaryTextColor, bold: true) + this.AddChild(new TextWidget(content.group_title, pointSize: theme.H1PointSize, textColor: theme.TextColor, bold: true) { HAnchor = HAnchor.Left, Margin = new BorderDouble(leftRightMargin, 5) diff --git a/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeDetailsView.cs b/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeDetailsView.cs index cda91467b..ee6238565 100644 --- a/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeDetailsView.cs +++ b/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeDetailsView.cs @@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow TextWidget AddSetting(string title, string value) { - var textWidget = new TextWidget(value, textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + var textWidget = new TextWidget(value, textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center diff --git a/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeLayerDetailsView.cs b/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeLayerDetailsView.cs index 20dea445d..7f2b96615 100644 --- a/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeLayerDetailsView.cs +++ b/MatterControlLib/PartPreviewWindow/GCodeDetails/GCodeLayerDetailsView.cs @@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow TextWidget AddSetting(string title, string value) { - var textWidget = new TextWidget(value, textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + var textWidget = new TextWidget(value, textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center diff --git a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs index 6fff7d6b3..4b12fed66 100644 --- a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs +++ b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs @@ -115,7 +115,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ToolTipText = "See what's new in this version of MatterControl".Localize(), VAnchor = VAnchor.Center, Margin = new BorderDouble(10, 0), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; seeWhatsNewButton.Click += (s, e) => UiThread.RunOnIdle(() => { @@ -178,7 +178,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow double pulseTime = 1; double totalSeconds = 0; var textWidgets = updateAvailableButton.Descendants().Where((w) => w.Visible == true).ToArray(); - Color startColor = theme.Colors.PrimaryTextColor; + Color startColor = theme.TextColor; // Show a highlight on the button as the user did not click it Animation flashBackground = null; flashBackground = new Animation() diff --git a/MatterControlLib/PartPreviewWindow/MaterialControls.cs b/MatterControlLib/PartPreviewWindow/MaterialControls.cs index f616218f5..3c046e21e 100644 --- a/MatterControlLib/PartPreviewWindow/MaterialControls.cs +++ b/MatterControlLib/PartPreviewWindow/MaterialControls.cs @@ -77,14 +77,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow DrawGrid = true, }); - buttonView.AddChild(new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + buttonView.AddChild(new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { VAnchor = VAnchor.Center }); var radioButtonView = new RadioButtonView(buttonView) { - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; radioButtonView.RadioCircle.Margin = radioButtonView.RadioCircle.Margin.Clone(right: 5); @@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { HAnchor = HAnchor.Fit, VAnchor = VAnchor.Fit, - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Checked = extruderIndex == initialMaterialIndex }; materialButtons.Add(radioButton); diff --git a/MatterControlLib/PartPreviewWindow/Object3DTreeBuilder.cs b/MatterControlLib/PartPreviewWindow/Object3DTreeBuilder.cs index 9abb451aa..6cf33b4c3 100644 --- a/MatterControlLib/PartPreviewWindow/Object3DTreeBuilder.cs +++ b/MatterControlLib/PartPreviewWindow/Object3DTreeBuilder.cs @@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { Text = "Loading".Localize(), Tag = item.Source, - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, PointSize = theme.DefaultFontSize, }; } @@ -93,7 +93,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { Text = GetName(item), Tag = item.Source, - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, PointSize = theme.DefaultFontSize, }; diff --git a/MatterControlLib/PartPreviewWindow/PopupMenu.cs b/MatterControlLib/PartPreviewWindow/PopupMenu.cs index 03256537f..4324ba46a 100644 --- a/MatterControlLib/PartPreviewWindow/PopupMenu.cs +++ b/MatterControlLib/PartPreviewWindow/PopupMenu.cs @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { GuiWidget content; - var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Padding = MenuPadding, }; @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow VAnchor = VAnchor.Fit }; - content.AddChild(new TextWidget(shortCut, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + content.AddChild(new TextWidget(shortCut, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { HAnchor = HAnchor.Right }); @@ -141,7 +141,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow arrow.LineTo(x - 3, y + 5); arrow.LineTo(x - 3, y - 5); - graphics2D.Render(arrow, theme.Colors.PrimaryTextColor); + graphics2D.Render(arrow, theme.TextColor); } public bool KeepMenuOpen @@ -223,14 +223,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow RadioImage.DrawCircle( radioIconChecked.NewGraphics2D(), rect.Center, - theme.Colors.PrimaryTextColor, + theme.TextColor, isChecked: true, isActive: false); RadioImage.DrawCircle( radioIconUnchecked.NewGraphics2D(), rect.Center, - theme.Colors.PrimaryTextColor, + theme.TextColor, isChecked: false, isActive: false); } @@ -279,7 +279,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public void CreateSubMenu(string menuTitle, ThemeConfig menuTheme, Action populateSubMenu, ImageBuffer icon = null) { - var content = new TextWidget(menuTitle, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + var content = new TextWidget(menuTitle, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Padding = MenuPadding, }; @@ -332,7 +332,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public MenuItem CreateBoolMenuItem(string name, Func getter, Action setter, bool useRadioStyle = false, IList siblingRadioButtonList = null) { - var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Padding = MenuPadding, }; @@ -348,7 +348,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; row.AddChild(new IconButton(icon, theme)); - var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Padding = MenuPadding, VAnchor = VAnchor.Center diff --git a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs index dbdee9351..1c03c6890 100644 --- a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs +++ b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs @@ -587,7 +587,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow VAnchor = VAnchor.Center }); - var timeWidget = new TextWidget("", pointSize: 22, textColor: theme.Colors.PrimaryTextColor) + var timeWidget = new TextWidget("", pointSize: 22, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(10, 0, 0, 0), diff --git a/MatterControlLib/PartPreviewWindow/SaveAsPage.cs b/MatterControlLib/PartPreviewWindow/SaveAsPage.cs index 362d5fe97..87c6c3281 100644 --- a/MatterControlLib/PartPreviewWindow/SaveAsPage.cs +++ b/MatterControlLib/PartPreviewWindow/SaveAsPage.cs @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl { var fileNameHeader = new TextWidget("Design Name".Localize(), pointSize: 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5), HAnchor = HAnchor.Left }; diff --git a/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs b/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs index 2664edec9..3f33bee19 100644 --- a/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs +++ b/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs @@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow currentLayerInfo = new InlineEditControl("1000") { Name = "currentLayerInfo", - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, GetDisplayString = (value) => $"{value}", HAnchor = HAnchor.Right | HAnchor.Fit, VAnchor = VAnchor.Absolute | VAnchor.Fit, @@ -147,7 +147,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { this.sceneContext = sceneContext; - layerCountText = new TextWidget("", pointSize: 9, textColor: ActiveTheme.Instance.PrimaryTextColor) + layerCountText = new TextWidget("", pointSize: 9, textColor: theme.TextColor) { MinimumSize = new Vector2(20, 20), AutoExpandBoundsToText = true, @@ -176,7 +176,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; this.AddChild(layerSlider); - layerStartText = new TextWidget("1", pointSize: 9, textColor: ActiveTheme.Instance.PrimaryTextColor) + layerStartText = new TextWidget("1", pointSize: 9, textColor: theme.TextColor) { AutoExpandBoundsToText = true, HAnchor = HAnchor.Center diff --git a/MatterControlLib/PartPreviewWindow/SpeedsLegend.cs b/MatterControlLib/PartPreviewWindow/SpeedsLegend.cs index 74806b6f5..c3bafbfec 100644 --- a/MatterControlLib/PartPreviewWindow/SpeedsLegend.cs +++ b/MatterControlLib/PartPreviewWindow/SpeedsLegend.cs @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }); this.AddChild( - new TextWidget($"{millimetersPerSecond} mm/s", pointSize: pointSize, textColor: ActiveTheme.Instance.PrimaryTextColor) + new TextWidget($"{millimetersPerSecond} mm/s", pointSize: pointSize, textColor: AppContext.Theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(8, 0), diff --git a/MatterControlLib/PartPreviewWindow/Tabs.cs b/MatterControlLib/PartPreviewWindow/Tabs.cs index 84881c30c..8bb7f540b 100644 --- a/MatterControlLib/PartPreviewWindow/Tabs.cs +++ b/MatterControlLib/PartPreviewWindow/Tabs.cs @@ -370,11 +370,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (iconImage != null) { - tabPill = new TabPill(tabLabel, ActiveTheme.Instance.PrimaryTextColor, iconImage, pointSize); + tabPill = new TabPill(tabLabel, theme.TextColor, iconImage, pointSize); } else { - tabPill = new TabPill(tabLabel, ActiveTheme.Instance.PrimaryTextColor, tabImageUrl, pointSize); + tabPill = new TabPill(tabLabel, theme.TextColor, tabImageUrl, pointSize); } tabPill.Margin = (hasClose) ? new BorderDouble(right: 16) : 0; diff --git a/MatterControlLib/PartPreviewWindow/View3D/Actions/ImageEditor.cs b/MatterControlLib/PartPreviewWindow/View3D/Actions/ImageEditor.cs index bc337e409..1394dadd4 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Actions/ImageEditor.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Actions/ImageEditor.cs @@ -185,7 +185,7 @@ namespace MatterHackers.MatterControl.DesignTools imageSection.ContentPanel.AddChild(row); // Invert checkbox - var invertCheckbox = new CheckBox(new CheckBoxViewText("Invert".Localize(), textColor: theme.Colors.PrimaryTextColor)) + var invertCheckbox = new CheckBox(new CheckBoxViewText("Invert".Localize(), textColor: theme.TextColor)) { Checked = imageObject.Invert, Margin = new BorderDouble(0), diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs index a9b894a13..e33a6f0ab 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow BackgroundColor = menuTheme.ActiveTabColor }; - column.AddChild(new TextWidget("Options".Localize(), textColor: menuTheme.Colors.PrimaryTextColor) + column.AddChild(new TextWidget("Options".Localize(), textColor: menuTheme.TextColor) { HAnchor = HAnchor.Left }); diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs index a114c3a59..dbf1f43ba 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs @@ -199,7 +199,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (!buttonIsBeingClicked) { - activeButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); + activeButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.TextColor, 6).ToColor()); } } }; diff --git a/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs b/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs index 2fbccd35e..a7a77ef4e 100644 --- a/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs +++ b/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs @@ -78,7 +78,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow iconButton.SetIcon(viewIcons[sceneContext.ViewState.RenderType]); if (!this.MenuVisible) { - iconButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); + iconButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.TextColor, 6).ToColor()); } } } diff --git a/MatterControlLib/PrinterControls/ControlWidgets/FanControls.cs b/MatterControlLib/PrinterControls/ControlWidgets/FanControls.cs index 674de0981..275fce69e 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/FanControls.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/FanControls.cs @@ -90,7 +90,7 @@ namespace MatterHackers.MatterControl.PrinterControls container.Selectable = true; // put in % - container.AddChild(new TextWidget("%", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("%", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center }); diff --git a/MatterControlLib/PrinterControls/ControlWidgets/MacroControls.cs b/MatterControlLib/PrinterControls/ControlWidgets/MacroControls.cs index 91c5833b3..dae2a16b3 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/MacroControls.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/MacroControls.cs @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PrinterControls if (!printer.Settings.Macros.Any()) { - var noMacrosFound = new TextWidget("No macros are currently set up for this printer.".Localize(), pointSize: 10, textColor: theme.Colors.PrimaryTextColor); + var noMacrosFound = new TextWidget("No macros are currently set up for this printer.".Localize(), pointSize: 10, textColor: theme.TextColor); this.AddChild(noMacrosFound); } else diff --git a/MatterControlLib/PrinterControls/ControlWidgets/MovementControls.cs b/MatterControlLib/PrinterControls/ControlWidgets/MovementControls.cs index 277c1b7a6..f84c736e2 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/MovementControls.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/MovementControls.cs @@ -156,7 +156,7 @@ namespace MatterHackers.MatterControl.PrinterControls // Display the current baby step offset stream values var offsetStreamLabel = new TextWidget("Z Offset".Localize() + ":", pointSize: 8) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(left: 10), AutoExpandBoundsToText = true, VAnchor = VAnchor.Center @@ -191,9 +191,9 @@ namespace MatterHackers.MatterControl.PrinterControls Padding = 0 }; - var xPosition = new TextWidget("X: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor); - var yPosition = new TextWidget("Y: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor); - var zPosition = new TextWidget("Z: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor); + var xPosition = new TextWidget("X: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor); + var yPosition = new TextWidget("Y: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor); + var zPosition = new TextWidget("Z: 0.0 ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor); hwDestinationBar.AddChild(xPosition); hwDestinationBar.AddChild(yPosition); @@ -284,7 +284,7 @@ namespace MatterHackers.MatterControl.PrinterControls zOffsetStreamDisplay = new TextWidget(zoffset.ToString("0.##"), pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5, 0, 8, 0), VAnchor = VAnchor.Center }; diff --git a/MatterControlLib/PrinterControls/EditLevelingSettingsPage.cs b/MatterControlLib/PrinterControls/EditLevelingSettingsPage.cs index 50ad5fa7e..b4ac5bceb 100644 --- a/MatterControlLib/PrinterControls/EditLevelingSettingsPage.cs +++ b/MatterControlLib/PrinterControls/EditLevelingSettingsPage.cs @@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Stretch }; - var positionLabel = new TextWidget("{0} {1,-5}".FormatWith("Position".Localize(), row + 1), textColor: ActiveTheme.Instance.PrimaryTextColor); + var positionLabel = new TextWidget("{0} {1,-5}".FormatWith("Position".Localize(), row + 1), textColor: theme.TextColor); positionLabel.VAnchor = VAnchor.Center; leftRightEdit.AddChild(positionLabel); @@ -108,7 +108,7 @@ namespace MatterHackers.MatterControl } leftRightEdit.AddChild( - new TextWidget($" {axisName}: ", textColor: ActiveTheme.Instance.PrimaryTextColor) + new TextWidget($" {axisName}: ", textColor: theme.TextColor) { VAnchor = VAnchor.Center }); diff --git a/MatterControlLib/PrinterControls/JogControls.cs b/MatterControlLib/PrinterControls/JogControls.cs index b0b6ed5c1..a60200b25 100644 --- a/MatterControlLib/PrinterControls/JogControls.cs +++ b/MatterControlLib/PrinterControls/JogControls.cs @@ -164,7 +164,7 @@ namespace MatterHackers.MatterControl moveRadioButtons.Margin = new BorderDouble(0, 3); setMoveDistanceControl.AddChild(moveRadioButtons); - moveRadioButtons.AddChild(new TextWidget("mm", textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 8) + moveRadioButtons.AddChild(new TextWidget("mm", textColor: theme.TextColor, pointSize: 8) { Margin = new BorderDouble(left: 10), VAnchor = VAnchor.Center @@ -457,7 +457,7 @@ namespace MatterHackers.MatterControl TextWidget eMinusControlLabel = new TextWidget("Retract".Localize(), pointSize: 11) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Center }; eMinusButtonAndText.AddChild(eMinusControlLabel); @@ -506,7 +506,7 @@ namespace MatterHackers.MatterControl } TextWidget ePlusControlLabel = new TextWidget("Extrude".Localize(), pointSize: 11); - ePlusControlLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; + ePlusControlLabel.TextColor = theme.TextColor; ePlusControlLabel.VAnchor = VAnchor.Center; ePlusButtonAndText.AddChild(ePlusControlLabel); eButtons.AddChild(ePlusButtonAndText); @@ -563,7 +563,7 @@ namespace MatterHackers.MatterControl } setMoveDistanceControl.AddChild( - new TextWidget("mm", textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 8) + new TextWidget("mm", textColor: theme.TextColor, pointSize: 8) { VAnchor = VAnchor.Center, Margin = new BorderDouble(left: 10) diff --git a/MatterControlLib/PrinterControls/MacroDetailPage.cs b/MatterControlLib/PrinterControls/MacroDetailPage.cs index a21229be4..a778e3183 100644 --- a/MatterControlLib/PrinterControls/MacroDetailPage.cs +++ b/MatterControlLib/PrinterControls/MacroDetailPage.cs @@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl ContentRow.AddChild(new TextWidget("Macro Name".Localize() + ":", 0, 0, 12) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 0, 0, 1) }); @@ -71,14 +71,14 @@ namespace MatterHackers.MatterControl ContentRow.AddChild(macroNameError = new TextWidget("Give the macro a name".Localize() + ".", 0, 0, 10) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }); ContentRow.AddChild(new TextWidget("Macro Commands".Localize() + ":", 0, 0, 12) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 0, 0, 1) }); @@ -94,7 +94,7 @@ namespace MatterHackers.MatterControl ContentRow.AddChild(macroCommandError = new TextWidget("This should be in 'G-Code'".Localize() + ".", 0, 0, 10) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }); diff --git a/MatterControlLib/PrinterControls/MacroListPage.cs b/MatterControlLib/PrinterControls/MacroListPage.cs index eaf5f013c..4e8097244 100644 --- a/MatterControlLib/PrinterControls/MacroListPage.cs +++ b/MatterControlLib/PrinterControls/MacroListPage.cs @@ -78,7 +78,7 @@ namespace MatterHackers.MatterControl Padding = new BorderDouble(3), }; - macroRow.AddChild(new TextWidget(GCodeMacro.FixMacroName(macro.Name), textColor: theme.Colors.PrimaryTextColor)); + macroRow.AddChild(new TextWidget(GCodeMacro.FixMacroName(macro.Name), textColor: theme.TextColor)); macroRow.AddChild(new HorizontalSpacer()); @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl var editLink = new LinkLabel("edit".Localize(), theme) { Margin = new BorderDouble(right: 5), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; editLink.Click += (s, e) => { @@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl var removeLink = new LinkLabel("remove".Localize(), theme) { - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; removeLink.Click += (sender, e) => { diff --git a/MatterControlLib/PrinterControls/MovementSpeedsPage.cs b/MatterControlLib/PrinterControls/MovementSpeedsPage.cs index fc2f01d2e..16fbf2834 100644 --- a/MatterControlLib/PrinterControls/MovementSpeedsPage.cs +++ b/MatterControlLib/PrinterControls/MovementSpeedsPage.cs @@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl this.WindowSize = new Vector2(500 * GuiWidget.DeviceScale, 320 * GuiWidget.DeviceScale); - var rightLabel = new TextWidget("mm/s".Localize(), textColor: theme.Colors.PrimaryTextColor, pointSize: theme.FontSize10) + var rightLabel = new TextWidget("mm/s".Localize(), textColor: theme.TextColor, pointSize: theme.FontSize10) { VAnchor = VAnchor.Center, Margin = new BorderDouble(right: 20) @@ -66,7 +66,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Stretch }; - headerBar.AddChild(new TextWidget(this.WindowTitle, textColor: theme.Colors.PrimaryTextColor, pointSize: theme.FontSize10)); + headerBar.AddChild(new TextWidget(this.WindowTitle, textColor: theme.TextColor, pointSize: theme.FontSize10)); ContentRow.AddChild(headerBar); @@ -87,11 +87,11 @@ namespace MatterHackers.MatterControl if (settingsArray[i].StartsWith("e")) { - axisLabel = new TextWidget(string.Format("{0}(s)", "Extruder".Localize()), textColor: ActiveTheme.Instance.PrimaryTextColor); + axisLabel = new TextWidget(string.Format("{0}(s)", "Extruder".Localize()), textColor: theme.TextColor); } else { - axisLabel = new TextWidget(string.Format("{0} {1}", "Axis".Localize(), settingsArray[i].ToUpper()), textColor: ActiveTheme.Instance.PrimaryTextColor); + axisLabel = new TextWidget(string.Format("{0} {1}", "Axis".Localize(), settingsArray[i].ToUpper()), textColor: theme.TextColor); } axisLabel.VAnchor = VAnchor.Center; row.AddChild(axisLabel); diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepBaudRate.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepBaudRate.cs index 2f1509d40..0efa308c0 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepBaudRate.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepBaudRate.cs @@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections string baudRateLabelTextFull = string.Format("{0}:", baudRateLabelText); TextWidget baudRateLabel = new TextWidget(baudRateLabelTextFull, 0, 0, 12); - baudRateLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; + baudRateLabel.TextColor = theme.TextColor; baudRateLabel.Margin = new BorderDouble(0, 0, 0, 10); baudRateLabel.HAnchor = HAnchor.Stretch; @@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections baudRateMessageContainer.HAnchor = HAnchor.Stretch; printerBaudRateError = new TextWidget("Select the baud rate.".Localize(), 0, 0, 10); - printerBaudRateError.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerBaudRateError.TextColor = theme.TextColor; printerBaudRateError.AutoExpandBoundsToText = true; printerBaudRateHelpLink = new LinkLabel("What's this?".Localize(), theme) @@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerBaudRateHelpLink.Click += printerBaudRateHelp_Click; printerBaudRateHelpMessage = new TextWidget("The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000.".Localize(), 0, 0, 10); - printerBaudRateHelpMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerBaudRateHelpMessage.TextColor = theme.TextColor; printerBaudRateHelpMessage.Margin = new BorderDouble(top: 10); printerBaudRateHelpMessage.Visible = false; @@ -143,7 +143,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections RadioButton baudOption = new RadioButton(baudRate); BaudRateButtonsList.Add(baudOption); baudOption.Margin = baudRateMargin; - baudOption.TextColor = ActiveTheme.Instance.PrimaryTextColor; + baudOption.TextColor = theme.TextColor; if (printer.Settings.GetValue(SettingsKey.baud_rate) == baudRate) { baudOption.Checked = true; @@ -153,7 +153,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections otherBaudRateRadioButton = new RadioButton("Other".Localize()); otherBaudRateRadioButton.Margin = baudRateMargin; - otherBaudRateRadioButton.TextColor = ActiveTheme.Instance.PrimaryTextColor; + otherBaudRateRadioButton.TextColor = theme.TextColor; baudRateContainer.AddChild(otherBaudRateRadioButton); diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortManual.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortManual.cs index 91b77828d..bcbc95f15 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortManual.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortManual.cs @@ -83,10 +83,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections try { printerComPortHelpLink.Visible = false; - printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerComPortError.TextColor = theme.TextColor; printerComPortError.Text = "Attempting to connect".Localize() + "..."; - printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerComPortError.TextColor = theme.TextColor; printer.Settings.Helpers.SetComPort(GetSelectedSerialPort()); printer.Connection.Connect(); @@ -139,7 +139,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var comPortLabel = new TextWidget("Serial Port".Localize() + ":", 0, 0, 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(0, 0, 0, 10), HAnchor = HAnchor.Stretch }; @@ -155,7 +155,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerComPortError = new TextWidget("Currently available serial ports.".Localize(), 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, AutoExpandBoundsToText = true }; @@ -168,7 +168,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections 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, + TextColor = theme.TextColor, Margin = new BorderDouble(top: 10), Visible = false }; @@ -191,7 +191,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections if (printer.Connection.IsConnected) { printerComPortHelpLink.Visible = false; - printerComPortError.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerComPortError.TextColor = theme.TextColor; printerComPortError.Text = "Connection succeeded".Localize() + "!"; nextButton.Visible = true; connectButton.Visible = false; @@ -243,7 +243,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var comPortOption = new TextWidget("No COM ports available".Localize()) { Margin = new BorderDouble(3, 6, 5, 6), - TextColor = ActiveTheme.Instance.PrimaryTextColor + TextColor = theme.TextColor }; comPortContainer.AddChild(comPortOption); } @@ -255,7 +255,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { HAnchor = HAnchor.Left, Margin = new BorderDouble(3, 3, 5, 3), - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Checked = isActivePrinterPort }; } diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs index 7b7e126cc..154b90001 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortOne.cs @@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var printerMessageOne = new TextWidget("MatterControl will now attempt to auto-detect printer.".Localize(), 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; @@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var printerMessageTwo = new TextWidget(string.Format("1.) {0} ({1}).", "Disconnect printer".Localize(), "if currently connected".Localize()), 0, 0, 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; @@ -69,7 +69,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var printerMessageThree = new TextWidget(string.Format("2.) {0} '{1}'.", "Press".Localize(), "Continue".Localize()), 0, 0, 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var setupManualConfigurationOrSkipConnectionWidget = new TextWidget("You can also".Localize() + ":", 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; @@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var manualLink = new LinkLabel("Manually Configure Connection".Localize(), theme) { Margin = new BorderDouble(0, 5), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; manualLink.Click += (s, e) => UiThread.RunOnIdle(() => { @@ -108,7 +108,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var printerMessageFour = new TextWidget("or".Localize(), 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; @@ -117,7 +117,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var skipConnectionLink = new LinkLabel("Skip Connection Setup".Localize(), theme) { Margin = new BorderDouble(0, 8), - TextColor = theme.Colors.PrimaryTextColor + TextColor = theme.TextColor }; skipConnectionLink.Click += (s, e) => UiThread.RunOnIdle(() => { diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs index 2157b9bb0..153779ffd 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections } else { - printerErrorMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerErrorMessage.TextColor = theme.TextColor; printerErrorMessage.Text = "Attempting to connect".Localize() + "..."; printer.Settings.Helpers.SetComPort(candidatePort); @@ -120,14 +120,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections string printerMessageOneText = "MatterControl will now attempt to auto-detect printer.".Localize(); TextWidget printerMessageOne = new TextWidget(printerMessageOneText, 0, 0, 10); printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5); - printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerMessageOne.TextColor = theme.TextColor; printerMessageOne.HAnchor = HAnchor.Stretch; printerMessageOne.Margin = elementMargin; 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; + printerMessageFour.TextColor = theme.TextColor; printerMessageFour.HAnchor = HAnchor.Stretch; printerMessageFour.Margin = elementMargin; @@ -135,7 +135,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections string printerMessageFiveTxtEnd = "Connect".Localize(); string printerMessageFiveTxtFull = string.Format("2.) {0} '{1}'.", printerMessageFiveTxtBeg, printerMessageFiveTxtEnd); TextWidget printerMessageFive = new TextWidget(printerMessageFiveTxtFull, 0, 0, 12); - printerMessageFive.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerMessageFive.TextColor = theme.TextColor; printerMessageFive.HAnchor = HAnchor.Stretch; printerMessageFive.Margin = elementMargin; @@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { if (printer.Connection.IsConnected) { - printerErrorMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor; + printerErrorMessage.TextColor = theme.TextColor; printerErrorMessage.Text = "Connection succeeded".Localize() + "!"; nextButton.Visible = true; connectButton.Visible = false; diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs index cdb19a280..579dc5c3d 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs @@ -126,7 +126,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var commonMargin = new BorderDouble(4, 2); // Create export button for each plugin - signInRadioButton = new RadioButton(new RadioButtonViewText("Sign in to access your existing printers".Localize(), theme.Colors.PrimaryTextColor)) + signInRadioButton = new RadioButton(new RadioButtonViewText("Sign in to access your existing printers".Localize(), theme.TextColor)) { HAnchor = HAnchor.Left, Margin = commonMargin.Clone(bottom: 10), @@ -135,7 +135,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections }; ContentRow.AddChild(signInRadioButton); - createPrinterRadioButton = new RadioButton(new RadioButtonViewText("Create a new printer", theme.Colors.PrimaryTextColor)) + createPrinterRadioButton = new RadioButton(new RadioButtonViewText("Create a new printer", theme.TextColor)) { HAnchor = HAnchor.Left, Margin = commonMargin, @@ -218,7 +218,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { TextWidget printerNameLabel = new TextWidget("Name".Localize() + ":", 0, 0, 12) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 4, 0, 1) }; @@ -231,7 +231,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerNameError = new TextWidget("", 0, 0, 10) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(top: 3) }; @@ -252,7 +252,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { var sectionLabel = new TextWidget(labelText, 0, 0, 12) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; diff --git a/MatterControlLib/PrinterControls/TerminalWindow/TerminalWidget.cs b/MatterControlLib/PrinterControls/TerminalWindow/TerminalWidget.cs index 940053886..128307f2a 100644 --- a/MatterControlLib/PrinterControls/TerminalWindow/TerminalWidget.cs +++ b/MatterControlLib/PrinterControls/TerminalWindow/TerminalWidget.cs @@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl filterOutput = new CheckBox("Filter Output".Localize(), textSize: theme.DefaultFontSize) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Bottom, }; filterOutput.CheckedStateChanged += (s, e) => @@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl { Margin = new BorderDouble(left: 25), Checked = UserSettings.Instance.Fields.GetBool(UserSettingsKey.TerminalAutoUppercase, true), - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, VAnchor = VAnchor.Bottom }; autoUppercase.CheckedStateChanged += (s, e) => @@ -106,7 +106,7 @@ namespace MatterHackers.MatterControl textScrollWidget = new TextScrollWidget(printer, printer.Connection.TerminalLog.PrinterLines) { BackgroundColor = theme.MinimalShade, - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Stretch, Margin = 0, diff --git a/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs b/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs index 11ef4f64e..2bbb36038 100644 --- a/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs +++ b/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs @@ -58,15 +58,15 @@ namespace MatterHackers.MatterControl { var printerNameLabel = new TextWidget("Connect Your Device".Localize() + ":", 0, 0, labelFontSize) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(bottom: 10) }; ContentRow.AddChild(printerNameLabel); - ContentRow.AddChild(new TextWidget("Instructions".Localize() + ":", 0, 0, 12,textColor:ActiveTheme.Instance.PrimaryTextColor)); - ContentRow.AddChild(new TextWidget("1. Power on your 3D Printer.".Localize(), 0, 0, 12,textColor:ActiveTheme.Instance.PrimaryTextColor)); - ContentRow.AddChild(new TextWidget("2. Attach your 3D Printer via USB.".Localize(), 0, 0, 12,textColor:ActiveTheme.Instance.PrimaryTextColor)); - ContentRow.AddChild(new TextWidget("3. Press 'Connect'.".Localize(), 0, 0, 12,textColor:ActiveTheme.Instance.PrimaryTextColor)); + ContentRow.AddChild(new TextWidget("Instructions".Localize() + ":", 0, 0, 12,textColor:theme.TextColor)); + ContentRow.AddChild(new TextWidget("1. Power on your 3D Printer.".Localize(), 0, 0, 12,textColor:theme.TextColor)); + ContentRow.AddChild(new TextWidget("2. Attach your 3D Printer via USB.".Localize(), 0, 0, 12,textColor:theme.TextColor)); + ContentRow.AddChild(new TextWidget("3. Press 'Connect'.".Localize(), 0, 0, 12,textColor:theme.TextColor)); //Add inputs to main container ApplicationController.Instance.ActivePrinter.Connection.CommunicationStateChanged.RegisterEvent(communicationStateChanged, ref unregisterEvents); @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl connectButtonContainer.AddChild(new HorizontalSpacer()); ContentRow.AddChild(connectButtonContainer); - skipMessage = new TextWidget("(Press 'Skip' to setup connection later)".Localize(), 0, 0, 10, textColor: ActiveTheme.Instance.PrimaryTextColor); + skipMessage = new TextWidget("(Press 'Skip' to setup connection later)".Localize(), 0, 0, 10, textColor: theme.TextColor); ContentRow.AddChild(skipMessage); generalError = new TextWidget("", 0, 0, errorFontSize) diff --git a/MatterControlLib/SetupWizard/AndroidNetworkTroubleshootingPage.cs b/MatterControlLib/SetupWizard/AndroidNetworkTroubleshootingPage.cs index 056331a59..37c6730d7 100644 --- a/MatterControlLib/SetupWizard/AndroidNetworkTroubleshootingPage.cs +++ b/MatterControlLib/SetupWizard/AndroidNetworkTroubleshootingPage.cs @@ -40,7 +40,7 @@ namespace MatterHackers.MatterControl ContentRow.AddChild( new TextWidget( "MatterControl was unable to connect to the Internet. Please check your Wifi connection and try again".Localize() + "...", - textColor: ActiveTheme.Instance.PrimaryTextColor)); + textColor: theme.TextColor)); var configureButton = theme.CreateDialogButton("Configure Wifi".Localize()); configureButton.Margin = new BorderDouble(0, 0, 10, 0); diff --git a/MatterControlLib/SetupWizard/CopyGuestProfilesToUser.cs b/MatterControlLib/SetupWizard/CopyGuestProfilesToUser.cs index bc04a13c9..c83f0ce47 100644 --- a/MatterControlLib/SetupWizard/CopyGuestProfilesToUser.cs +++ b/MatterControlLib/SetupWizard/CopyGuestProfilesToUser.cs @@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl }; scrollWindow.AddChild(container); - container.AddChild(new WrappedTextWidget(importMessage, textColor: ActiveTheme.Instance.PrimaryTextColor)); + container.AddChild(new WrappedTextWidget(importMessage, textColor: theme.TextColor)); var byCheckbox = new Dictionary(); @@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl { container.AddChild(new TextWidget("Printers to Copy".Localize() + ":") { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(0, 3, 0, 15), }); @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl { var checkBox = new CheckBox(printerInfo.Name) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5, 0, 0, 0), HAnchor = HAnchor.Left, Checked = true, @@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl }); }; - rememberChoice = new CheckBox("Don't remind me again".Localize(), ActiveTheme.Instance.PrimaryTextColor); + rememberChoice = new CheckBox("Don't remind me again".Localize(), theme.TextColor); ContentRow.AddChild(rememberChoice); syncButton.Visible = true; diff --git a/MatterControlLib/SetupWizard/DialogPage.cs b/MatterControlLib/SetupWizard/DialogPage.cs index 01feb7434..6d3a236b8 100644 --- a/MatterControlLib/SetupWizard/DialogPage.cs +++ b/MatterControlLib/SetupWizard/DialogPage.cs @@ -129,7 +129,7 @@ namespace MatterHackers.MatterControl headerRow.Padding = new BorderDouble(0, 3, 0, 3); headerLabel.PointSize = 14; - headerLabel.TextColor = theme.Colors.PrimaryTextColor; + headerLabel.TextColor = theme.TextColor; ContentRow.Padding = new BorderDouble(5); footerRow.Padding = 0; diff --git a/MatterControlLib/SetupWizard/HelpPage.cs b/MatterControlLib/SetupWizard/HelpPage.cs index dfd6d401f..1be26b0f8 100644 --- a/MatterControlLib/SetupWizard/HelpPage.cs +++ b/MatterControlLib/SetupWizard/HelpPage.cs @@ -365,7 +365,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Fit | (left ? HAnchor.Right: HAnchor.Left), VAnchor = VAnchor.Fit }; - var content = new TextWidget(text, bold: bold, textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + var content = new TextWidget(text, bold: bold, textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { Margin = (left ? new BorderDouble(5, 3, 10, 3) : new BorderDouble(10, 3, 5, 3)) }; diff --git a/MatterControlLib/SetupWizard/ImportSettingsPage.cs b/MatterControlLib/SetupWizard/ImportSettingsPage.cs index a6af35719..2e0a89115 100644 --- a/MatterControlLib/SetupWizard/ImportSettingsPage.cs +++ b/MatterControlLib/SetupWizard/ImportSettingsPage.cs @@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl { container.AddChild(new TextWidget("Quality Presets:") { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(0, 3), }); @@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl { var qualityButton = new RadioButton(string.IsNullOrEmpty(qualitySetting.Name) ? "no name" : qualitySetting.Name) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5, 0, 0, 0), HAnchor = HAnchor.Left, }; @@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl { container.AddChild(new TextWidget("Material Presets:") { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(0, 3, 0, 15), }); @@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl { var materialButton = new RadioButton(string.IsNullOrEmpty(materialSetting.Name) ? "no name" : materialSetting.Name) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5, 0), HAnchor = HAnchor.Left, }; @@ -244,7 +244,7 @@ namespace MatterHackers.MatterControl this.WindowTitle = "Import Wizard".Localize(); this.HeaderText = "Import Successful".Localize(); - ContentRow.AddChild(new WrappedTextWidget(successMessage, textColor: theme.Colors.PrimaryTextColor)); + ContentRow.AddChild(new WrappedTextWidget(successMessage, textColor: theme.TextColor)); } } } \ No newline at end of file diff --git a/MatterControlLib/SetupWizard/InputBoxPage.cs b/MatterControlLib/SetupWizard/InputBoxPage.cs index 10b28ee91..ee7b42641 100644 --- a/MatterControlLib/SetupWizard/InputBoxPage.cs +++ b/MatterControlLib/SetupWizard/InputBoxPage.cs @@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl ContentRow.AddChild(new TextWidget(label, pointSize: 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(5), HAnchor = HAnchor.Left }); diff --git a/MatterControlLib/SetupWizard/LicenseAgreementPage.cs b/MatterControlLib/SetupWizard/LicenseAgreementPage.cs index e25cee7f1..1683caa6d 100644 --- a/MatterControlLib/SetupWizard/LicenseAgreementPage.cs +++ b/MatterControlLib/SetupWizard/LicenseAgreementPage.cs @@ -48,7 +48,7 @@ public class LicenseAgreementPage : DialogPage ContentRow.AddChild(scrollable); scrollable.ScrollArea.Margin = new BorderDouble(0, 0, 15, 0); - scrollable.AddChild(new WrappedTextWidget(eulaText, textColor: ActiveTheme.Instance.PrimaryTextColor, doubleBufferText: false) + scrollable.AddChild(new WrappedTextWidget(eulaText, textColor: theme.TextColor, doubleBufferText: false) { DrawFromHintedCache = true, Name = "LicenseAgreementPage", diff --git a/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs b/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs index a455d0846..f70449b84 100644 --- a/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs +++ b/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.SetupWizard private async void LoadHistoryItems() { TextWidget loadingText = new TextWidget("Retrieving History from Web..."); - loadingText.TextColor = ActiveTheme.Instance.PrimaryTextColor; + loadingText.TextColor = theme.TextColor; scrollWindow.AddChild(loadingText); var results = await ApplicationController.GetProfileHistory?.Invoke(ProfileManager.Instance.ActiveProfile.DeviceToken); @@ -90,7 +90,7 @@ namespace MatterHackers.MatterControl.SetupWizard foreach (var group in groupedTimes) { // add in the group header - topToBottomStuff.AddChild(new TextWidget(RelativeTime.BlockDescriptions[group.Key], textColor: ActiveTheme.Instance.PrimaryTextColor) + topToBottomStuff.AddChild(new TextWidget(RelativeTime.BlockDescriptions[group.Key], textColor: theme.TextColor) { Margin = new BorderDouble(0, 0, 0, 5), }); @@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl.SetupWizard foreach (var time in group.Value) { // add in the radio buttons - var profileVersionButton = new RadioButton(time.Value, textColor: ActiveTheme.Instance.PrimaryTextColor) + var profileVersionButton = new RadioButton(time.Value, textColor: theme.TextColor) { Margin = new BorderDouble(5, 0), }; diff --git a/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs b/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs index 1c3308e05..54b0e7e3f 100644 --- a/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs +++ b/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs @@ -96,7 +96,7 @@ namespace MatterHackers.MatterControl // Regen and refresh the troubleshooting criteria var printerNameLabel = new TextWidget(string.Format("{0}:", "Connection Troubleshooting".Localize()), 0, 0, labelFontSize) { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(bottom: 10) }; diff --git a/MatterControlLib/SetupWizard/SetupWizardWifi.cs b/MatterControlLib/SetupWizard/SetupWizardWifi.cs index c6e35655a..70177cf1d 100644 --- a/MatterControlLib/SetupWizard/SetupWizardWifi.cs +++ b/MatterControlLib/SetupWizard/SetupWizardWifi.cs @@ -44,12 +44,12 @@ namespace MatterHackers.MatterControl ContentRow.AddChild(new TextWidget("Wifi Setup".Localize() + ":", 0, 0, labelFontSize) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Margin = new BorderDouble(bottom: 10) }); - ContentRow.AddChild(new TextWidget("Some features may require an internet connection.".Localize(), 0, 0, 12, textColor: ActiveTheme.Instance.PrimaryTextColor)); - ContentRow.AddChild(new TextWidget("Would you like to setup Wifi?".Localize(), 0, 0, 12, textColor: ActiveTheme.Instance.PrimaryTextColor)); + ContentRow.AddChild(new TextWidget("Some features may require an internet connection.".Localize(), 0, 0, 12, textColor: theme.TextColor)); + ContentRow.AddChild(new TextWidget("Would you like to setup Wifi?".Localize(), 0, 0, 12, textColor: theme.TextColor)); var connectButtonContainer = new FlowLayoutWidget() { diff --git a/MatterControlLib/SlicerConfiguration/PresetSelectorWidget.cs b/MatterControlLib/SlicerConfiguration/PresetSelectorWidget.cs index 0215ff19b..b4c769409 100644 --- a/MatterControlLib/SlicerConfiguration/PresetSelectorWidget.cs +++ b/MatterControlLib/SlicerConfiguration/PresetSelectorWidget.cs @@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.Padding = theme.DefaultContainerPadding; // Section Label - this.AddChild(new TextWidget(label, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + this.AddChild(new TextWidget(label, pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { HAnchor = HAnchor.Left, Margin = new BorderDouble(0) diff --git a/MatterControlLib/SlicerConfiguration/SettingsRow.cs b/MatterControlLib/SlicerConfiguration/SettingsRow.cs index 8bb39de39..ca94958a7 100644 --- a/MatterControlLib/SlicerConfiguration/SettingsRow.cs +++ b/MatterControlLib/SlicerConfiguration/SettingsRow.cs @@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }); } - this.AddChild(settingsLabel = SettingsRow.CreateSettingsLabel(title, helpText, theme.Colors.PrimaryTextColor)); + this.AddChild(settingsLabel = SettingsRow.CreateSettingsLabel(title, helpText, theme.TextColor)); this.AddChild(new HorizontalSpacer()); } diff --git a/MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs b/MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs index c3de49669..78db1e5f3 100644 --- a/MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs +++ b/MatterControlLib/SlicerConfiguration/SliceSettingsRow.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration && settingData.DataEditType != SliceSettingData.DataEditTypes.HARDWARE_PRESENT) { unitsArea.AddChild( - new WrappedTextWidget(settingData.Units.Localize(), pointSize: 8, textColor: theme.Colors.PrimaryTextColor) + new WrappedTextWidget(settingData.Units.Localize(), pointSize: 8, textColor: theme.TextColor) { Margin = new BorderDouble(5, 0), }); diff --git a/MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs b/MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs index 06bedfc8f..062df9599 100644 --- a/MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs +++ b/MatterControlLib/SlicerConfiguration/SliceSettingsWidget.cs @@ -163,7 +163,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }; // Add heading for My Settings view - searchPanel.AddChild(filteredItemsHeading = new TextWidget("My Modified Settings", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor) + searchPanel.AddChild(filteredItemsHeading = new TextWidget("My Modified Settings", pointSize: theme.DefaultFontSize, textColor: theme.TextColor) { Margin = new BorderDouble(left: 10), HAnchor = HAnchor.Left, @@ -591,7 +591,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration row.AddChild(new TextWidget(title, pointSize: 9) { Margin = new BorderDouble(0, 4, 10, 4), - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, }); row.AddChild(new HorizontalSpacer()); @@ -599,7 +599,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration row.AddChild(new TextWidget(lastUpdateTime, pointSize: 9) { Margin = new BorderDouble(0, 4, 10, 4), - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, }); } @@ -745,7 +745,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration case SliceSettingData.DataEditTypes.OFFSET2: placeFieldInDedicatedRow = true; - uiField = new ExtruderOffsetField(settingsContext, settingData.SlicerConfigName, theme.Colors.PrimaryTextColor, theme); + uiField = new ExtruderOffsetField(settingsContext, settingData.SlicerConfigName, theme.TextColor, theme); break; #if !__ANDROID__ case SliceSettingData.DataEditTypes.IP_LIST: @@ -757,7 +757,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration // Missing Setting settingsRow.AddContent(new TextWidget($"Missing the setting for '{settingData.DataEditType}'.") { - TextColor = theme.Colors.PrimaryTextColor, + TextColor = theme.TextColor, BackgroundColor = Color.Red }); break; @@ -808,7 +808,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration if (settingData.QuickMenuSettings.Count > 0 && settingData.SlicerConfigName == "baud_rate") { - var dropMenu = new DropMenuWrappedField(uiField, settingData, theme.Colors.PrimaryTextColor, theme); + var dropMenu = new DropMenuWrappedField(uiField, settingData, theme.TextColor, theme); dropMenu.Initialize(tabIndexForItem); settingsRow.AddContent(dropMenu.Content); diff --git a/MatterControlLib/SlicerConfiguration/UIFields/CheckboxField.cs b/MatterControlLib/SlicerConfiguration/UIFields/CheckboxField.cs index ce3a6e9bc..b627ee8cb 100644 --- a/MatterControlLib/SlicerConfiguration/UIFields/CheckboxField.cs +++ b/MatterControlLib/SlicerConfiguration/UIFields/CheckboxField.cs @@ -37,16 +37,22 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public class CheckboxField : UIField { private CheckBox checkBoxWidget; + private ThemeConfig theme; public bool Checked => checkBoxWidget.Checked; + public CheckboxField(ThemeConfig theme) + { + this.theme = theme; + } + public override void Initialize(int tabIndex) { checkBoxWidget = new CheckBox("") { VAnchor = VAnchor.Bottom, Name = this.Name, - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.TextColor, Checked = this.Value == "1" }; checkBoxWidget.CheckedStateChanged += (s, e) => diff --git a/MatterControlLib/SlicerConfiguration/UIFields/IpAddessField.cs b/MatterControlLib/SlicerConfiguration/UIFields/IpAddessField.cs index fc9ffb539..b6e03b434 100644 --- a/MatterControlLib/SlicerConfiguration/UIFields/IpAddessField.cs +++ b/MatterControlLib/SlicerConfiguration/UIFields/IpAddessField.cs @@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration TabIndex = tabIndex, Enabled = canChangeComPort, - TextColor = canChangeComPort ? theme.Colors.PrimaryTextColor : new Color(theme.Colors.PrimaryTextColor, 150), + TextColor = canChangeComPort ? theme.TextColor : new Color(theme.TextColor, 150), }; //Create default option @@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration printer.Connection.CommunicationStateChanged.RegisterEvent((s, e) => { canChangeComPort = !printer.Connection.IsConnected && printer.Connection.CommunicationState != CommunicationStates.AttemptingToConnect; - dropdownList.TextColor = theme.Colors.PrimaryTextColor; + dropdownList.TextColor = theme.TextColor; dropdownList.Enabled = canChangeComPort; }, ref unregisterEvents); diff --git a/MatterControlLib/SlicerConfiguration/UIFields/TextField.cs b/MatterControlLib/SlicerConfiguration/UIFields/TextField.cs index ce4c5d8c9..363e44733 100644 --- a/MatterControlLib/SlicerConfiguration/UIFields/TextField.cs +++ b/MatterControlLib/SlicerConfiguration/UIFields/TextField.cs @@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public override void Initialize(int tabIndex) { - textWidget = new TextWidget("", textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) + textWidget = new TextWidget("", textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { TabIndex = tabIndex, ToolTipText = this.HelpText, diff --git a/MatterControlLib/SlicerConfiguration/UIFields/Vector2Field.cs b/MatterControlLib/SlicerConfiguration/UIFields/Vector2Field.cs index f2ea9735e..a9d313f54 100644 --- a/MatterControlLib/SlicerConfiguration/UIFields/Vector2Field.cs +++ b/MatterControlLib/SlicerConfiguration/UIFields/Vector2Field.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration userInitiated: true); }; - container.AddChild(new TextWidget("X:", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("X:", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(5, 0), @@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration userInitiated: true); }; - container.AddChild(new TextWidget("Y:", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("Y:", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(15, 0, 5, 0), diff --git a/MatterControlLib/SlicerConfiguration/UIFields/Vector3Field.cs b/MatterControlLib/SlicerConfiguration/UIFields/Vector3Field.cs index 1e45e34f9..968c39e2c 100644 --- a/MatterControlLib/SlicerConfiguration/UIFields/Vector3Field.cs +++ b/MatterControlLib/SlicerConfiguration/UIFields/Vector3Field.cs @@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration userInitiated: true); }; - container.AddChild(new TextWidget("X:", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("X:", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(5, 0), @@ -116,7 +116,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration userInitiated: true); }; - container.AddChild(new TextWidget("Y:", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("Y:", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(15, 0, 5, 0), @@ -141,7 +141,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration userInitiated: true); }; - container.AddChild(new TextWidget("Z:", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor) + container.AddChild(new TextWidget("Z:", pointSize: 10, textColor: theme.TextColor) { VAnchor = VAnchor.Center, Margin = new BorderDouble(15, 0, 5, 0), diff --git a/MatterControlLib/Utilities/MarkdigAgg/AggRenderer.cs b/MatterControlLib/Utilities/MarkdigAgg/AggRenderer.cs index 620fb25e4..425d7625a 100644 --- a/MatterControlLib/Utilities/MarkdigAgg/AggRenderer.cs +++ b/MatterControlLib/Utilities/MarkdigAgg/AggRenderer.cs @@ -19,7 +19,7 @@ namespace Markdig.Renderers public class TextWordX : TextWidget { public TextWordX(ThemeConfig theme) - : base("", pointSize: 10, textColor: theme.Colors.PrimaryTextColor) + : base("", pointSize: 10, textColor: theme.TextColor) { this.AutoExpandBoundsToText = true; } @@ -28,7 +28,7 @@ namespace Markdig.Renderers public class TextSpaceX : TextWidget, ISkipIfFirst { public TextSpaceX(ThemeConfig theme) - : base("", pointSize: 10, textColor: theme.Colors.PrimaryTextColor) + : base("", pointSize: 10, textColor: theme.TextColor) { this.AutoExpandBoundsToText = true; } diff --git a/StaticData/Themes/System/Classic/Classic-Dark.json b/StaticData/Themes/System/Classic/Classic-Dark.json index e368e2264..50af23de9 100644 --- a/StaticData/Themes/System/Classic/Classic-Dark.json +++ b/StaticData/Themes/System/Classic/Classic-Dark.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#FFFFFF", - "SourceColor": "#AC193D" - }, + "TextColor": "#FFFFFF", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Classic/Classic-Light.json b/StaticData/Themes/System/Classic/Classic-Light.json index 266adbf92..661b1b73a 100644 --- a/StaticData/Themes/System/Classic/Classic-Light.json +++ b/StaticData/Themes/System/Classic/Classic-Light.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#222222", - "SourceColor": "#AC193D" - }, + "TextColor": "#222222", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Menus/White-Menu.json b/StaticData/Themes/System/Menus/White-Menu.json index 511b7aa8c..2e72ec0e8 100644 --- a/StaticData/Themes/System/Menus/White-Menu.json +++ b/StaticData/Themes/System/Menus/White-Menu.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#222222", - "SourceColor": "#AC193D" - }, + "TextColor": "#222222", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Modern/Modern-Dark-Menu.json b/StaticData/Themes/System/Modern/Modern-Dark-Menu.json index 9eb07f723..46aa4c604 100644 --- a/StaticData/Themes/System/Modern/Modern-Dark-Menu.json +++ b/StaticData/Themes/System/Modern/Modern-Dark-Menu.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#EEEEEE", - "SourceColor": "#B58900" - }, + "TextColor": "#EEEEEE", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Modern/Modern-Dark.json b/StaticData/Themes/System/Modern/Modern-Dark.json index 06ce2581b..bee139962 100644 --- a/StaticData/Themes/System/Modern/Modern-Dark.json +++ b/StaticData/Themes/System/Modern/Modern-Dark.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#BBBBBB", - "SourceColor": "#00000000" - }, + "TextColor": "#BBBBBB", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Solarized/Solarized-Dark.json b/StaticData/Themes/System/Solarized/Solarized-Dark.json index 2013c541c..4fe0306fc 100644 --- a/StaticData/Themes/System/Solarized/Solarized-Dark.json +++ b/StaticData/Themes/System/Solarized/Solarized-Dark.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#839496", - "SourceColor": "#B58900" - }, + "TextColor": "#839496", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Solarized/Solarized-Light-Menu.json b/StaticData/Themes/System/Solarized/Solarized-Light-Menu.json index 35d7757ac..2df2689f0 100644 --- a/StaticData/Themes/System/Solarized/Solarized-Light-Menu.json +++ b/StaticData/Themes/System/Solarized/Solarized-Light-Menu.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#555555", - "SourceColor": "#B58900" - }, + "TextColor": "#555555", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/StaticData/Themes/System/Solarized/Solarized-Light.json b/StaticData/Themes/System/Solarized/Solarized-Light.json index 984d6d35e..3300d7246 100644 --- a/StaticData/Themes/System/Solarized/Solarized-Light.json +++ b/StaticData/Themes/System/Solarized/Solarized-Light.json @@ -1,9 +1,6 @@ { "DefaultFontSize": 11, - "Colors": { - "PrimaryTextColor": "#657B83", - "SourceColor": "#B58900" - }, + "TextColor": "#657B83", "PresetColors": { "MaterialPreset": "#FF7F00", "QualityPreset": "#FFFF00", diff --git a/Tests/MatterControl.Tests/MatterControl/BoundDropListTests.cs b/Tests/MatterControl.Tests/MatterControl/BoundDropListTests.cs index 0167d85e7..a89b2dd2d 100644 --- a/Tests/MatterControl.Tests/MatterControl/BoundDropListTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/BoundDropListTests.cs @@ -24,10 +24,7 @@ namespace MatterControl.Tests.MatterControl BoundDropList dropList; - var theme = new ThemeConfig() - { - Colors = ActiveTheme.Instance as ThemeColors - }; + var theme = new ThemeConfig(); // Whitelist on non-OEM builds should contain all printers dropList = new BoundDropList("Test", theme);