From 151e753db239b8ee131a429b5c603db7a045dab6 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 15 Oct 2018 18:25:53 -0700 Subject: [PATCH] Move PrimaryAccentColor to parent --- MatterControlLib/AboutPage/AboutPage.cs | 2 +- .../ActionBar/TemperatureWidgetBed.cs | 2 +- .../ActionBar/TemperatureWidgetExtruder.cs | 2 +- .../ApplicationView/ThemeConfig.cs | 7 ++++--- .../ApplicationView/Themes/ActiveTheme.cs | 9 ++++++++- .../Themes/ClassicColorsTheme.cs | 20 ++++++++++--------- .../ApplicationView/Themes/IThemeColors.cs | 2 -- .../ApplicationView/Themes/SolarizedTheme.cs | 6 +++--- .../ApplicationView/Themes/ThemeColors.cs | 17 ++++++++-------- .../ApplicationSettings/ThemeColorPanel.cs | 2 +- .../ApplicationSettings/ThemePreviewButton.cs | 2 +- .../WizardPages/WaitForTempPage.cs | 4 ++-- .../ConfigurationPage/RunningMacroPage.cs | 2 +- .../CustomWidgets/DockingTabControl.cs | 2 +- .../CustomWidgets/DoubleSolidSlider.cs | 16 +++++++-------- MatterControlLib/CustomWidgets/LinkLabel.cs | 2 +- .../PrintingWindow/BedStatusWidget.cs | 4 ++-- .../PrintingWindow/ExtruderStatusWidget.cs | 4 ++-- .../PrintingWindow/ProgressDial.cs | 13 +++++++----- .../PrintingWindow/TemperatureStatusWidget.cs | 4 ++-- .../CustomWidgets/SimpleButton.cs | 4 ++-- .../CustomWidgets/SingleWindowProvider.cs | 2 +- MatterControlLib/CustomWidgets/SolidSlider.cs | 8 ++++---- .../History/PrintHistoryListItem.cs | 6 +++--- MatterControlLib/Library/ExtensionMethods.cs | 4 ++-- .../Library/Widgets/InsertionGroupObject3D.cs | 10 +++++----- .../Library/Widgets/ListView/ListView.cs | 4 ++-- .../Widgets/ListView/ListViewItemBase.cs | 2 +- .../PartPreviewWindow/PrinterTabPage.cs | 12 +++++------ .../PartPreviewWindow/RoundedToggleSwitch.cs | 6 +++--- .../PartPreviewWindow/RunningTaskRow.cs | 4 ++-- .../PartPreviewWindow/SliceLayerSelector.cs | 6 +++--- MatterControlLib/PartPreviewWindow/Tabs.cs | 2 +- .../View3D/DragDropLoadProgress.cs | 4 ++-- .../View3D/MeshViewerWidget.cs | 2 +- .../View3D/PrinterBar/PrinterActionsBar.cs | 2 +- .../PartPreviewWindow/ViewStyleButton.cs | 2 +- .../ControlWidgets/AdjustmentControls.cs | 4 ++-- .../SetupStepMakeModelName.cs | 2 +- .../ApplicationSettingsPage.cs | 2 +- .../SetupWizard/AndroidConnectDevicePage.cs | 2 +- MatterControlLib/SetupWizard/DialogPage.cs | 2 +- .../SetupWizard/SetupWizardTroubleshooting.cs | 2 +- 43 files changed, 113 insertions(+), 103 deletions(-) diff --git a/MatterControlLib/AboutPage/AboutPage.cs b/MatterControlLib/AboutPage/AboutPage.cs index eb8ff4db1..64a8badbb 100644 --- a/MatterControlLib/AboutPage/AboutPage.cs +++ b/MatterControlLib/AboutPage/AboutPage.cs @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl Width = 100, }; altHeadingRow.AddChild(spinnerPanel); - var accentColor = theme.Colors.PrimaryAccentColor; + var accentColor = theme.PrimaryAccentColor; var spinner = new LogoSpinner(spinnerPanel, 4, 0.2, 0, rotateX: 0) { diff --git a/MatterControlLib/ActionBar/TemperatureWidgetBed.cs b/MatterControlLib/ActionBar/TemperatureWidgetBed.cs index 96e02a2cd..16c368f0b 100644 --- a/MatterControlLib/ActionBar/TemperatureWidgetBed.cs +++ b/MatterControlLib/ActionBar/TemperatureWidgetBed.cs @@ -129,7 +129,7 @@ namespace MatterHackers.MatterControl.ActionBar DynamicallyScaleRange = false, MinValue = 0, ShowGoal = true, - GoalColor = ActiveTheme.Instance.PrimaryAccentColor, + GoalColor = menuTheme.PrimaryAccentColor, GoalValue = printer.Settings.GetValue(SettingsKey.bed_temperature), MaxValue = 150, // could come from some profile value in the future Width = widget.Width - 20, diff --git a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs index 81db0c49d..2a204c65e 100644 --- a/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs +++ b/MatterControlLib/ActionBar/TemperatureWidgetExtruder.cs @@ -287,7 +287,7 @@ namespace MatterHackers.MatterControl.ActionBar DynamicallyScaleRange = false, MinValue = 0, ShowGoal = true, - GoalColor = ActiveTheme.Instance.PrimaryAccentColor, + GoalColor = menuTheme.PrimaryAccentColor, GoalValue = printer.Settings.Helpers.ExtruderTemperature(hotendIndex), MaxValue = 280, // could come from some profile value in the future Width = widget.Width - 20, diff --git a/MatterControlLib/ApplicationView/ThemeConfig.cs b/MatterControlLib/ApplicationView/ThemeConfig.cs index 9a5936389..f2165a526 100644 --- a/MatterControlLib/ApplicationView/ThemeConfig.cs +++ b/MatterControlLib/ApplicationView/ThemeConfig.cs @@ -178,6 +178,7 @@ namespace MatterHackers.MatterControl public Color DisabledColor { get; set; } public Color SplashAccentColor { get; set; } public Color BedBackgroundColor { get; set; } + public Color PrimaryAccentColor { get; set; } public GuiWidget CreateSearchButton() { @@ -196,7 +197,7 @@ namespace MatterHackers.MatterControl public void SetDefaults() { this.DisabledColor = new Color(this.LightTextColor, 50); - this.SplashAccentColor = new Color(this.Colors.PrimaryAccentColor, 185).OverlayOn(Color.White).ToColor(); + this.SplashAccentColor = new Color(this.PrimaryAccentColor, 185).OverlayOn(Color.White).ToColor(); } public void RebuildTheme() @@ -402,7 +403,7 @@ namespace MatterHackers.MatterControl }; } - public SolidSlider CreateSolidSlider(GuiWidget wordOptionContainer, string header, double min = 0, double max = .5) + public SolidSlider CreateSolidSlider(GuiWidget wordOptionContainer, string header, ThemeConfig theme, double min = 0, double max = .5) { double scrollBarWidth = 10; @@ -412,7 +413,7 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Left }); - var namedSlider = new SolidSlider(new Vector2(), scrollBarWidth, 0, 1) + var namedSlider = new SolidSlider(new Vector2(), scrollBarWidth, theme, 0, 1) { TotalWidthInPixels = defaultScrollBarWidth, Minimum = min, diff --git a/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs b/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs index 5d2eab25b..b76ccc1c0 100644 --- a/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs +++ b/MatterControlLib/ApplicationView/Themes/ActiveTheme.cs @@ -35,7 +35,14 @@ namespace MatterHackers.Agg.UI { public static RootedObjectEventHandler ThemeChanged = new RootedObjectEventHandler(); - private static IThemeColors activeTheme = ThemeColors.Create(new Color(172, 25, 61) /* Classic Red */); + private static IThemeColors activeTheme; + + static ActiveTheme() + { + Color accentColor; + + (activeTheme, accentColor) = ThemeColors.Create(new Color(172, 25, 61) /* Classic Red */); + } public static IThemeColors Instance { diff --git a/MatterControlLib/ApplicationView/Themes/ClassicColorsTheme.cs b/MatterControlLib/ApplicationView/Themes/ClassicColorsTheme.cs index 5adc2e0b1..89c6d61a3 100644 --- a/MatterControlLib/ApplicationView/Themes/ClassicColorsTheme.cs +++ b/MatterControlLib/ApplicationView/Themes/ClassicColorsTheme.cs @@ -84,37 +84,39 @@ namespace MatterHackers.MatterControl { bool darkTheme = mode == "Dark"; Console.WriteLine("Requesting theme for " + accentColor.Html); - var colors = ThemeColors.Create(accentColor, darkTheme); - Console.WriteLine("Generated: PrimaryAccent: " + colors.PrimaryAccentColor + " source: " + colors.SourceColor); + var (colors, modifiedAccentColor) = ThemeColors.Create(accentColor, darkTheme); - return ThemeFromColors(colors, darkTheme); + Console.WriteLine("Generated: PrimaryAccent: " + modifiedAccentColor + " source: " + colors.SourceColor); + + return ThemeFromColors(colors, modifiedAccentColor, darkTheme); } - public static ThemeSet ThemeFromColors(ThemeColors colors, bool darkTheme) + public static ThemeSet ThemeFromColors(ThemeColors colors, Color accentColor, bool darkTheme) { var json = JsonConvert.SerializeObject(colors); var clonedColors = JsonConvert.DeserializeObject(json); clonedColors.PrimaryTextColor = new Color("#222"); - var menuTheme = BuildTheme(clonedColors, darkTheme); + var menuTheme = BuildTheme(clonedColors, accentColor, darkTheme); menuTheme.ActiveTabColor = new Color("#f1f1f1"); menuTheme.IsDarkTheme = false; return new ThemeSet() { - Theme = BuildTheme(colors, darkTheme), + Theme = BuildTheme(colors, accentColor, darkTheme), MenuTheme = menuTheme }; } - private static ThemeConfig BuildTheme(ThemeColors colors, bool darkTheme) + private static ThemeConfig BuildTheme(ThemeColors colors, Color accentColor, bool darkTheme) { var theme = new ThemeConfig(); theme.Colors = colors; theme.IsDarkTheme = darkTheme; + theme.PrimaryAccentColor = accentColor; theme.SlightShade = new Color(0, 0, 0, 40); theme.MinimalShade = new Color(0, 0, 0, 15); @@ -128,7 +130,7 @@ namespace MatterHackers.MatterControl (darkTheme) ? 3 : 25)); theme.TabBarBackground = theme.ActiveTabColor.WithLightnessAdjustment(0.85).ToColor(); theme.ThumbnailBackground = Color.Transparent; - theme.AccentMimimalOverlay = new Color(theme.Colors.PrimaryAccentColor, 50); + theme.AccentMimimalOverlay = new Color(accentColor, 50); theme.InteractionLayerOverlayColor = new Color(theme.ActiveTabColor, 240); theme.InactiveTabColor = theme.ResolveColor(theme.ActiveTabColor, new Color(Color.White, darkTheme ? 20 : 60)); @@ -136,7 +138,7 @@ namespace MatterHackers.MatterControl theme.BorderColor = new Color(darkTheme ? "#C8C8C8" : "#333"); - theme.SplashAccentColor = theme.Colors.PrimaryAccentColor; + theme.SplashAccentColor = accentColor; theme.BedBackgroundColor = theme.ResolveColor(theme.ActiveTabColor, new Color(Color.Black, 20)); diff --git a/MatterControlLib/ApplicationView/Themes/IThemeColors.cs b/MatterControlLib/ApplicationView/Themes/IThemeColors.cs index 7e9578b67..fe0fb8bb6 100644 --- a/MatterControlLib/ApplicationView/Themes/IThemeColors.cs +++ b/MatterControlLib/ApplicationView/Themes/IThemeColors.cs @@ -34,7 +34,5 @@ namespace MatterHackers.Agg.UI public interface IThemeColors { Color PrimaryTextColor { get; } - - Color PrimaryAccentColor { get; } } } \ No newline at end of file diff --git a/MatterControlLib/ApplicationView/Themes/SolarizedTheme.cs b/MatterControlLib/ApplicationView/Themes/SolarizedTheme.cs index e4817d5c2..0193b8096 100644 --- a/MatterControlLib/ApplicationView/Themes/SolarizedTheme.cs +++ b/MatterControlLib/ApplicationView/Themes/SolarizedTheme.cs @@ -74,10 +74,10 @@ namespace MatterHackers.MatterControl Theme = new ThemeConfig() { IsDarkTheme = darkTheme, + PrimaryAccentColor = accentColor, Colors = new ThemeColors() { PrimaryTextColor = baseColors.Base0, - PrimaryAccentColor = accentColor, SourceColor = accentColor }, PresetColors = new PresetColors() @@ -118,10 +118,10 @@ namespace MatterHackers.MatterControl return new ThemeConfig() { IsDarkTheme = false, + PrimaryAccentColor = accentColor, Colors = new ThemeColors() { PrimaryTextColor = new Color("#555"), - PrimaryAccentColor = accentColor, SourceColor = accentColor }, PresetColors = new PresetColors() @@ -155,10 +155,10 @@ namespace MatterHackers.MatterControl return new ThemeConfig() { IsDarkTheme = true, + PrimaryAccentColor = accentColor, Colors = new ThemeColors() { PrimaryTextColor = baseColors.Base1, - PrimaryAccentColor = accentColor, SourceColor = accentColor }, PresetColors = new PresetColors() diff --git a/MatterControlLib/ApplicationView/Themes/ThemeColors.cs b/MatterControlLib/ApplicationView/Themes/ThemeColors.cs index 66bfc3204..b68c8fe42 100644 --- a/MatterControlLib/ApplicationView/Themes/ThemeColors.cs +++ b/MatterControlLib/ApplicationView/Themes/ThemeColors.cs @@ -35,20 +35,19 @@ namespace MatterHackers.Agg.UI { public Color PrimaryTextColor { get; set; } - public Color PrimaryAccentColor { get; set; } - public Color SourceColor { get; set; } - public static ThemeColors Create(Color accentColor, bool darkTheme = true) + 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"), - PrimaryAccentColor = GetAdjustedAccentColor(accentColor, primaryBackgroundColor), - SourceColor = accentColor, - }; + return ( + new ThemeColors + { + PrimaryTextColor = new Color(darkTheme ? "#FFFFFF" : "#222"), + SourceColor = accentColor, + }, + GetAdjustedAccentColor(accentColor, primaryBackgroundColor)); } public static Color GetAdjustedAccentColor(Color accentColor, Color backgroundColor) diff --git a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs index 88be0aac9..d85e90e6b 100644 --- a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs +++ b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemeColorPanel.cs @@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage var theme = AppContext.Theme; - var accentColor = theme.Colors.PrimaryAccentColor; + var accentColor = theme.PrimaryAccentColor; if (!_themeProvider.Colors.Contains(accentColor)) { diff --git a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemePreviewButton.cs b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemePreviewButton.cs index 201159774..8d3ee06be 100644 --- a/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemePreviewButton.cs +++ b/MatterControlLib/ConfigurationPage/ApplicationSettings/ThemePreviewButton.cs @@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage this.theme = theme; activeColor = theme.Colors.SourceColor; - var primaryAccentColor = theme.Colors.PrimaryAccentColor; + var primaryAccentColor = theme.PrimaryAccentColor; this.Padding = 8; this.BackgroundColor = theme.ActiveTabColor; diff --git a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs index 71804e0d0..f55ae0907 100644 --- a/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs +++ b/MatterControlLib/ConfigurationPage/PrintLeveling/WizardPages/WaitForTempPage.cs @@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling // put in the progress bar hotEndProgressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, BorderColor = ActiveTheme.Instance.PrimaryTextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 0), @@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling // put in progress bar bedProgressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, BorderColor = ActiveTheme.Instance.PrimaryTextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 0), diff --git a/MatterControlLib/ConfigurationPage/RunningMacroPage.cs b/MatterControlLib/ConfigurationPage/RunningMacroPage.cs index dd90a9582..e92c4c61c 100644 --- a/MatterControlLib/ConfigurationPage/RunningMacroPage.cs +++ b/MatterControlLib/ConfigurationPage/RunningMacroPage.cs @@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.PrinterControls var holder = new FlowLayoutWidget(); progressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale)) { - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, BorderColor = ActiveTheme.Instance.PrimaryTextColor, BackgroundColor = Color.White, Margin = new BorderDouble(3, 0, 0, 10), diff --git a/MatterControlLib/CustomWidgets/DockingTabControl.cs b/MatterControlLib/CustomWidgets/DockingTabControl.cs index a0b0f2640..21e6f6583 100644 --- a/MatterControlLib/CustomWidgets/DockingTabControl.cs +++ b/MatterControlLib/CustomWidgets/DockingTabControl.cs @@ -351,7 +351,7 @@ namespace MatterHackers.MatterControl.CustomWidgets public override void OnMouseEnterBounds(MouseEventArgs mouseEvent) { base.OnMouseEnterBounds(mouseEvent); - this.BorderColor = theme.Colors.PrimaryAccentColor; + this.BorderColor = theme.PrimaryAccentColor; } public override void OnMouseLeaveBounds(MouseEventArgs mouseEvent) diff --git a/MatterControlLib/CustomWidgets/DoubleSolidSlider.cs b/MatterControlLib/CustomWidgets/DoubleSolidSlider.cs index c17cb0fce..b88ef90cc 100644 --- a/MatterControlLib/CustomWidgets/DoubleSolidSlider.cs +++ b/MatterControlLib/CustomWidgets/DoubleSolidSlider.cs @@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl public Color TickColor { get; set; } - public DoubleSolidSlideView(DoubleSolidSlider sliderWidget) + public DoubleSolidSlideView(DoubleSolidSlider sliderWidget, ThemeConfig theme) { sliderAttachedTo = sliderWidget; @@ -68,7 +68,7 @@ namespace MatterHackers.MatterControl TextColor = Color.Black; TrackColor = new Color(220, 220, 220); - ThumbColor = ActiveTheme.Instance.PrimaryAccentColor; + ThumbColor = theme.PrimaryAccentColor; sliderWidget.FirstValueChanged += new EventHandler(sliderWidget_ValueChanged); sliderWidget.SecondValueChanged += new EventHandler(sliderWidget_ValueChanged); @@ -309,9 +309,9 @@ namespace MatterHackers.MatterControl public bool LargeChange { get; set; } - public DoubleSolidSlider(Vector2 positionOfTrackFirstValue, double widthInPixels, double minimum = 0, double maximum = 1, Orientation orientation = Orientation.Horizontal) + public DoubleSolidSlider(Vector2 positionOfTrackFirstValue, double widthInPixels, ThemeConfig theme, double minimum = 0, double maximum = 1, Orientation orientation = Orientation.Horizontal) { - View = new DoubleSolidSlideView(this); + View = new DoubleSolidSlideView(this, theme); View.TrackHeight = widthInPixels; OriginRelativeParent = positionOfTrackFirstValue; TotalWidthInPixels = widthInPixels; @@ -324,13 +324,13 @@ namespace MatterHackers.MatterControl MinimumSize = new Vector2(Width, Height); } - public DoubleSolidSlider(Vector2 lowerLeft, Vector2 upperRight) - : this(new Vector2(lowerLeft.X, lowerLeft.Y + (upperRight.Y - lowerLeft.Y) / 2), upperRight.X - lowerLeft.X) + public DoubleSolidSlider(Vector2 lowerLeft, Vector2 upperRight, ThemeConfig theme) + : this(new Vector2(lowerLeft.X, lowerLeft.Y + (upperRight.Y - lowerLeft.Y) / 2), upperRight.X - lowerLeft.X, theme) { } - public DoubleSolidSlider(double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY) - : this(new Vector2(lowerLeftX, lowerLeftY + (upperRightY - lowerLeftY) / 2), upperRightX - lowerLeftX) + public DoubleSolidSlider(double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY, ThemeConfig theme) + : this(new Vector2(lowerLeftX, lowerLeftY + (upperRightY - lowerLeftY) / 2), upperRightX - lowerLeftX, theme) { } diff --git a/MatterControlLib/CustomWidgets/LinkLabel.cs b/MatterControlLib/CustomWidgets/LinkLabel.cs index 179b8bdf3..6e494e582 100644 --- a/MatterControlLib/CustomWidgets/LinkLabel.cs +++ b/MatterControlLib/CustomWidgets/LinkLabel.cs @@ -42,7 +42,7 @@ namespace MatterHackers.MatterControl this.VAnchor = VAnchor.Fit; this.Cursor = Cursors.Hand; - this.AddChild(innerText = new TextWidget(text, pointSize: (pointSize == double.MinValue) ? theme.DefaultFontSize : pointSize, textColor: theme.Colors.PrimaryAccentColor) + this.AddChild(innerText = new TextWidget(text, pointSize: (pointSize == double.MinValue) ? theme.DefaultFontSize : pointSize, textColor: theme.PrimaryAccentColor) { Underline = true, Selectable = false diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/BedStatusWidget.cs b/MatterControlLib/CustomWidgets/PrintingWindow/BedStatusWidget.cs index 8e828ac44..f11157425 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/BedStatusWidget.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/BedStatusWidget.cs @@ -34,8 +34,8 @@ namespace MatterHackers.MatterControl.CustomWidgets { public class BedStatusWidget : TemperatureStatusWidget { - public BedStatusWidget(PrinterConfig printer, bool smallScreen) - : base(printer, smallScreen ? "Bed".Localize() : "Bed Temperature".Localize()) + public BedStatusWidget(PrinterConfig printer, bool smallScreen, ThemeConfig theme) + : base(printer, smallScreen ? "Bed".Localize() : "Bed Temperature".Localize(), theme) { printer.Connection.BedTemperatureRead.RegisterEvent((s, e) => { diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/ExtruderStatusWidget.cs b/MatterControlLib/CustomWidgets/PrintingWindow/ExtruderStatusWidget.cs index 5fd659ef4..16cbfc95e 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/ExtruderStatusWidget.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/ExtruderStatusWidget.cs @@ -36,8 +36,8 @@ namespace MatterHackers.MatterControl.CustomWidgets { private int extruderIndex; - public ExtruderStatusWidget(PrinterConfig printer, int extruderIndex) - : base(printer, $"{"Extruder".Localize()} {extruderIndex + 1}") + public ExtruderStatusWidget(PrinterConfig printer, int extruderIndex, ThemeConfig theme) + : base(printer, $"{"Extruder".Localize()} {extruderIndex + 1}", theme) { this.extruderIndex = extruderIndex; diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs b/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs index e4426607c..ea4db7d94 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/ProgressDial.cs @@ -55,14 +55,17 @@ namespace MatterHackers.MatterControl.CustomWidgets private TextWidget percentCompleteWidget; - private Color PrimaryAccentColor = ActiveTheme.Instance.PrimaryAccentColor; + private Color primaryAccentColor; - private Color PrimaryAccentShade = ActiveTheme.Instance.PrimaryAccentColor.WithLightnessAdjustment(0.7).ToColor(); + private Color primaryAccentShade; private double innerRingStrokeWidth = 10 * GuiWidget.DeviceScale; - public ProgressDial() + public ProgressDial(ThemeConfig theme) { + primaryAccentColor = theme.PrimaryAccentColor; + primaryAccentShade = theme.PrimaryAccentColor.WithLightnessAdjustment(0.7).ToColor(); + percentCompleteWidget = new TextWidget("", pointSize: 22, textColor: ActiveTheme.Instance.PrimaryTextColor) { AutoExpandBoundsToText = true, @@ -180,7 +183,7 @@ namespace MatterHackers.MatterControl.CustomWidgets arcStroke.width(outerRingStrokeWidth); graphics2D.Render( arcStroke.Rotate(90, AngleType.Degrees).Translate(bounds.Center), - PrimaryAccentShade); + primaryAccentShade); // Draw inner progress ring ringArc = new Arc( @@ -193,7 +196,7 @@ namespace MatterHackers.MatterControl.CustomWidgets arcStroke.width(innerRingStrokeWidth); graphics2D.Render( arcStroke.Rotate(90, AngleType.Degrees).Translate(bounds.Center), - PrimaryAccentColor); + primaryAccentColor); // Draw child controls base.OnDraw(graphics2D); diff --git a/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs b/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs index a948232ae..2e83981b6 100644 --- a/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs +++ b/MatterControlLib/CustomWidgets/PrintingWindow/TemperatureStatusWidget.cs @@ -42,7 +42,7 @@ namespace MatterHackers.MatterControl.CustomWidgets private int fontSize = 14; protected PrinterConfig printer; - public TemperatureStatusWidget(PrinterConfig printer, string dispalyName) + public TemperatureStatusWidget(PrinterConfig printer, string dispalyName, ThemeConfig theme) { this.printer = printer; var extruderName = new TextWidget(dispalyName, pointSize: fontSize, textColor: ActiveTheme.Instance.PrimaryTextColor) @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.CustomWidgets progressBar = new ProgressBar(200, 6) { - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, Margin = new BorderDouble(right: 10), BorderColor = Color.Transparent, BackgroundColor = new Color(ActiveTheme.Instance.PrimaryTextColor, 50), diff --git a/MatterControlLib/CustomWidgets/SimpleButton.cs b/MatterControlLib/CustomWidgets/SimpleButton.cs index 9d586f324..1fcaa46f2 100644 --- a/MatterControlLib/CustomWidgets/SimpleButton.cs +++ b/MatterControlLib/CustomWidgets/SimpleButton.cs @@ -312,7 +312,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { if (this.Checked) { - graphics2D.Rectangle(0, 0, LocalBounds.Right, 2, theme.Colors.PrimaryAccentColor); + graphics2D.Rectangle(0, 0, LocalBounds.Right, 2, theme.PrimaryAccentColor); } base.OnDraw(graphics2D); @@ -392,7 +392,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { if (this.Checked) { - graphics2D.Rectangle(LocalBounds.Left, 0, LocalBounds.Right, 2, theme.Colors.PrimaryAccentColor); + graphics2D.Rectangle(LocalBounds.Left, 0, LocalBounds.Right, 2, theme.PrimaryAccentColor); } base.OnDraw(graphics2D); diff --git a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs index 6cb3f2e2f..c85fabb67 100644 --- a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs +++ b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs @@ -73,7 +73,7 @@ namespace MatterHackers.Agg.UI var movable = new WindowWidget(systemWindow) { - WindowBorderColor = new Color(theme.Colors.PrimaryAccentColor, 175) + WindowBorderColor = new Color(theme.PrimaryAccentColor, 175) }; overlayWindow.AddChild(movable); diff --git a/MatterControlLib/CustomWidgets/SolidSlider.cs b/MatterControlLib/CustomWidgets/SolidSlider.cs index 44b5a5fe0..0895ca7c8 100644 --- a/MatterControlLib/CustomWidgets/SolidSlider.cs +++ b/MatterControlLib/CustomWidgets/SolidSlider.cs @@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl public Color TickColor { get; set; } - public SolidSlideView(SolidSlider sliderWidget) + public SolidSlideView(SolidSlider sliderWidget, ThemeConfig theme) { sliderAttachedTo = sliderWidget; @@ -66,7 +66,7 @@ namespace MatterHackers.MatterControl TextColor = Color.Black; TrackColor = new Color(220, 220, 220); - ThumbColor = ActiveTheme.Instance.PrimaryAccentColor; + ThumbColor = theme.PrimaryAccentColor; } private RectangleDouble GetTrackBounds() @@ -241,9 +241,9 @@ namespace MatterHackers.MatterControl public bool LargeChange { get; set; } - public SolidSlider(Vector2 positionOfTrackFirstValue, double thumbWidth, double minimum = 0, double maximum = 1, Orientation orientation = Orientation.Horizontal) + public SolidSlider(Vector2 positionOfTrackFirstValue, double thumbWidth, ThemeConfig theme, double minimum = 0, double maximum = 1, Orientation orientation = Orientation.Horizontal) { - View = new SolidSlideView(this); + View = new SolidSlideView(this, theme); View.TrackHeight = thumbWidth; OriginRelativeParent = positionOfTrackFirstValue; Orientation = orientation; diff --git a/MatterControlLib/History/PrintHistoryListItem.cs b/MatterControlLib/History/PrintHistoryListItem.cs index 8212a6f0e..fe613767f 100644 --- a/MatterControlLib/History/PrintHistoryListItem.cs +++ b/MatterControlLib/History/PrintHistoryListItem.cs @@ -319,7 +319,7 @@ namespace MatterHackers.MatterControl.PrintHistory if (this.isSelectedItem) { - this.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor; + this.BackgroundColor = theme.PrimaryAccentColor; this.partLabel.TextColor = Color.White; this.selectionCheckBox.TextColor = Color.White; @@ -332,11 +332,11 @@ namespace MatterHackers.MatterControl.PrintHistory RectangleDouble Bounds = LocalBounds; RoundedRect rectBorder = new RoundedRect(Bounds, 0); - this.BackgroundColor = ActiveTheme.Instance.PrimaryAccentColor; + this.BackgroundColor = theme.PrimaryAccentColor; this.partLabel.TextColor = Color.White; this.selectionCheckBox.TextColor = Color.White; - graphics2D.Render(new Stroke(rectBorder, 3), ActiveTheme.Instance.PrimaryAccentColor); + graphics2D.Render(new Stroke(rectBorder, 3), theme.PrimaryAccentColor); } else { diff --git a/MatterControlLib/Library/ExtensionMethods.cs b/MatterControlLib/Library/ExtensionMethods.cs index 4295ff63e..a11197563 100644 --- a/MatterControlLib/Library/ExtensionMethods.cs +++ b/MatterControlLib/Library/ExtensionMethods.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.Library // Color ExtensionMethods public static ImageBuffer MultiplyWithPrimaryAccent(this ImageBuffer sourceImage) { - return sourceImage.Multiply(ActiveTheme.Instance.PrimaryAccentColor); + return sourceImage.Multiply(ApplicationController.Instance.Theme.PrimaryAccentColor); } public static ImageBuffer SetPreMultiply(this ImageBuffer sourceImage) @@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl.Library public static ImageBuffer AlphaToPrimaryAccent(this ImageBuffer sourceImage) { - return sourceImage.AnyAlphaToColor(AppContext.Theme.Colors.PrimaryAccentColor); + return sourceImage.AnyAlphaToColor(ApplicationController.Instance.Theme.PrimaryAccentColor); } } } diff --git a/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs b/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs index 802f42f3a..e697dae4d 100644 --- a/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs +++ b/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs @@ -59,9 +59,9 @@ namespace MatterHackers.MatterControl.Library } // TODO: Figure out how best to collapse the InsertionGroup after the load task completes - public InsertionGroupObject3D(IEnumerable items, - View3DWidget view3DWidget, - InteractiveScene scene, + public InsertionGroupObject3D(IEnumerable items, + View3DWidget view3DWidget, + InteractiveScene scene, Vector2 newItemOffset, Action> layoutParts, bool trackSourceFiles = false) @@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.Library foreach (var item in items.Where(item => item.IsContentFileType()).ToList()) { // Acquire - var progressControl = new DragDropLoadProgress(view3DWidget, null); + var progressControl = new DragDropLoadProgress(view3DWidget, null, ApplicationController.Instance.Theme); // Position at accumulating offset placeholderItem.Matrix *= Matrix4X4.CreateTranslation(newItemOffset.X, (double)newItemOffset.Y, 0); @@ -125,7 +125,7 @@ namespace MatterHackers.MatterControl.Library loadedItem.Color = loadedItem.Color; // Set mesh path if tracking requested - if (trackSourceFiles + if (trackSourceFiles && item is FileSystemFileItem fileItem && item.IsMeshFileType()) { diff --git a/MatterControlLib/Library/Widgets/ListView/ListView.cs b/MatterControlLib/Library/Widgets/ListView/ListView.cs index 2b176187c..baa6a3ffa 100644 --- a/MatterControlLib/Library/Widgets/ListView/ListView.cs +++ b/MatterControlLib/Library/Widgets/ListView/ListView.cs @@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { contentView = new IconListView(theme); - loadingBackgroundColor = new Color(theme.Colors.PrimaryAccentColor, 10); + loadingBackgroundColor = new Color(theme.PrimaryAccentColor, 10); this.theme = theme; this.LibraryContext = context; @@ -330,7 +330,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.AddChild(this.contentView); this.ScrollArea.AddChild( - loadingIndicator = new ImageSequenceWidget(ApplicationController.Instance.GetProcessingSequence(theme.Colors.PrimaryAccentColor)) + loadingIndicator = new ImageSequenceWidget(ApplicationController.Instance.GetProcessingSequence(theme.PrimaryAccentColor)) { VAnchor = VAnchor.Top, HAnchor = HAnchor.Center, diff --git a/MatterControlLib/Library/Widgets/ListView/ListViewItemBase.cs b/MatterControlLib/Library/Widgets/ListView/ListViewItemBase.cs index cbe59f80f..b01e4a518 100644 --- a/MatterControlLib/Library/Widgets/ListView/ListViewItemBase.cs +++ b/MatterControlLib/Library/Widgets/ListView/ListViewItemBase.cs @@ -204,7 +204,7 @@ namespace MatterHackers.MatterControl.CustomWidgets public override Color BorderColor { - get => (this.IsSelected || mouseInBounds) ? theme.Colors.PrimaryAccentColor : base.BorderColor; + get => (this.IsSelected || mouseInBounds) ? theme.PrimaryAccentColor : base.BorderColor; set => base.BorderColor = value; } diff --git a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs index 4ac975fcc..0a712b522 100644 --- a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs +++ b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs @@ -101,7 +101,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; view3DWidget.InteractionLayer.AddChild(LayerScrollbar); - layerRenderRatioSlider = new DoubleSolidSlider(new Vector2(), SliceLayerSelector.SliderWidth); + layerRenderRatioSlider = new DoubleSolidSlider(new Vector2(), SliceLayerSelector.SliderWidth, theme); layerRenderRatioSlider.FirstValue = 0; layerRenderRatioSlider.FirstValueChanged += (s, e) => { @@ -434,20 +434,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (printer.ViewState.TerminalVisible) { - sideBar.AddPage("Terminal", - "Terminal".Localize(), + sideBar.AddPage("Terminal", + "Terminal".Localize(), new TerminalWidget(printer, theme) { VAnchor = VAnchor.Stretch, HAnchor = HAnchor.Stretch - }, + }, false); } if (printer.ViewState.ConfigurePrinterVisible) { sideBar.AddPage( - "Printer", + "Printer", "Printer".Localize(), new ConfigurePrinterWidget(sliceSettingsWidget.settingsContext, printer, theme) { @@ -484,7 +484,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; expandingContainer.AddChild(progressContainer); - var progressDial = new ProgressDial() + var progressDial = new ProgressDial(theme) { HAnchor = HAnchor.Center, Height = 200 * DeviceScale, diff --git a/MatterControlLib/PartPreviewWindow/RoundedToggleSwitch.cs b/MatterControlLib/PartPreviewWindow/RoundedToggleSwitch.cs index 02791ef57..580aa8b51 100644 --- a/MatterControlLib/PartPreviewWindow/RoundedToggleSwitch.cs +++ b/MatterControlLib/PartPreviewWindow/RoundedToggleSwitch.cs @@ -101,7 +101,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.theme = theme; this.DoubleBuffer = true; inactiveBarColor = theme.IsDarkTheme ? theme.Shade : theme.SlightShade; - activeBarColor = new Color(theme.Colors.PrimaryAccentColor, (theme.IsDarkTheme ? 100 : 70)); + activeBarColor = new Color(theme.PrimaryAccentColor, (theme.IsDarkTheme ? 100 : 70)); this.MinimumSize = new Vector2(minWidth, theme.ButtonHeight); } @@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { var position = new Vector2((this.Checked) ? LocalBounds.Right - toggleRadiusPlusPadding : toggleRadiusPlusPadding, centerY); position = this.TransformToScreenSpace(position); - Color toggleColor = (this.Checked) ? theme.Colors.PrimaryAccentColor : Color.Gray; + Color toggleColor = (this.Checked) ? theme.PrimaryAccentColor : Color.Gray; e.Graphics2D.Circle(position, animation.finalRadius * Quadratic.Out(animation.animationRatio), @@ -195,7 +195,7 @@ namespace MatterHackers.MatterControl.CustomWidgets var position = (this.Checked) ? LocalBounds.Right - toggleRadiusPlusPadding: toggleRadiusPlusPadding; Color barColor = (this.Checked) ? activeBarColor : inactiveBarColor; - Color toggleColor = (this.Checked) ? theme.Colors.PrimaryAccentColor : Color.Gray; + Color toggleColor = (this.Checked) ? theme.PrimaryAccentColor : Color.Gray; if (mouseIsDown && mouseInBounds) { diff --git a/MatterControlLib/PartPreviewWindow/RunningTaskRow.cs b/MatterControlLib/PartPreviewWindow/RunningTaskRow.cs index 703cf9d28..a28f98ffa 100644 --- a/MatterControlLib/PartPreviewWindow/RunningTaskRow.cs +++ b/MatterControlLib/PartPreviewWindow/RunningTaskRow.cs @@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow HAnchor = HAnchor.Stretch, Height = 2, VAnchor = VAnchor.Absolute | VAnchor.Bottom, - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, BorderColor = Color.Transparent, Margin = new BorderDouble(32, 7, theme.ButtonHeight * 2 + 14, 0), }; @@ -204,7 +204,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private void SetExpansionMode(ThemeConfig theme, GuiWidget detailsPanel, bool isExpanded) { expandButton.Checked = isExpanded; - progressBar.FillColor = isExpanded ? theme.Shade : theme.Colors.PrimaryAccentColor; + progressBar.FillColor = isExpanded ? theme.Shade : theme.PrimaryAccentColor; detailsPanel.Visible = isExpanded; } diff --git a/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs b/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs index c925cfbcb..a1b615bb3 100644 --- a/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs +++ b/MatterControlLib/PartPreviewWindow/SliceLayerSelector.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { this.sceneContext = sceneContext; - this.AddChild(layerScrollbar = new LayerScrollbar(printer, sceneContext) + this.AddChild(layerScrollbar = new LayerScrollbar(printer, sceneContext, theme) { VAnchor = VAnchor.Stretch, HAnchor = HAnchor.Right @@ -139,7 +139,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private TextWidget layerStartText; private BedConfig sceneContext; - public LayerScrollbar(PrinterConfig printer, BedConfig sceneContext) + public LayerScrollbar(PrinterConfig printer, BedConfig sceneContext, ThemeConfig theme) : base(FlowDirection.TopToBottom) { this.sceneContext = sceneContext; @@ -152,7 +152,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; this.AddChild(layerCountText); - layerSlider = new SolidSlider(new Vector2(), SliderWidth, 0, 1, Orientation.Vertical) + layerSlider = new SolidSlider(new Vector2(), SliderWidth, theme, 0, 1, Orientation.Vertical) { HAnchor = HAnchor.Center, VAnchor = VAnchor.Stretch, diff --git a/MatterControlLib/PartPreviewWindow/Tabs.cs b/MatterControlLib/PartPreviewWindow/Tabs.cs index 96210ffc1..4f1be2f85 100644 --- a/MatterControlLib/PartPreviewWindow/Tabs.cs +++ b/MatterControlLib/PartPreviewWindow/Tabs.cs @@ -502,7 +502,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public override Color BorderColor { - get => (this.IsActiveTab) ? theme.Colors.PrimaryAccentColor : base.BorderColor; + get => (this.IsActiveTab) ? theme.PrimaryAccentColor : base.BorderColor; set => base.BorderColor = value; } diff --git a/MatterControlLib/PartPreviewWindow/View3D/DragDropLoadProgress.cs b/MatterControlLib/PartPreviewWindow/View3D/DragDropLoadProgress.cs index 5cc60803d..3fc285486 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/DragDropLoadProgress.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/DragDropLoadProgress.cs @@ -38,14 +38,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private View3DWidget view3DWidget; private ProgressBar progressBar; - public DragDropLoadProgress(View3DWidget view3DWidget, IObject3D trackingObject) + public DragDropLoadProgress(View3DWidget view3DWidget, IObject3D trackingObject, ThemeConfig theme) { this.TrackingObject = trackingObject; this.view3DWidget = view3DWidget; view3DWidget.AfterDraw += View3DWidget_AfterDraw; progressBar = new ProgressBar(80, 15) { - FillColor = ActiveTheme.Instance.PrimaryAccentColor, + FillColor = theme.PrimaryAccentColor, }; } diff --git a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs index 0d531cc87..3455beb6f 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -328,7 +328,7 @@ namespace MatterHackers.MeshVisualizer Blue = theme.ResolveColor(theme.ActiveTabColor, new Color(Color.Blue, 195)) }; - gCodeMeshColor = new Color(theme.Colors.PrimaryAccentColor, 35); + gCodeMeshColor = new Color(theme.PrimaryAccentColor, 35); scene.SelectionChanged += (sender, e) => { diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/PrinterActionsBar.cs index d3af157cf..423cdf846 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.Colors.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); + activeButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); } } }; diff --git a/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs b/MatterControlLib/PartPreviewWindow/ViewStyleButton.cs index 838f86455..2fbccd35e 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.Colors.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); + iconButton.FlashBackground(theme.PrimaryAccentColor.WithContrast(theme.Colors.PrimaryTextColor, 6).ToColor()); } } } diff --git a/MatterControlLib/PrinterControls/ControlWidgets/AdjustmentControls.cs b/MatterControlLib/PrinterControls/ControlWidgets/AdjustmentControls.cs index 4663ab5d3..45566d902 100644 --- a/MatterControlLib/PrinterControls/ControlWidgets/AdjustmentControls.cs +++ b/MatterControlLib/PrinterControls/ControlWidgets/AdjustmentControls.cs @@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.PrinterControls // Remove the HorizontalSpacer settingsRow.Children.Last().Close(); - feedRateRatioSlider = new SolidSlider(new Vector2(), sliderThumbWidth, minFeedRateRatio, maxFeedRateRatio) + feedRateRatioSlider = new SolidSlider(new Vector2(), sliderThumbWidth, theme, minFeedRateRatio, maxFeedRateRatio) { Name = "Feed Rate Slider", Margin = new BorderDouble(5, 0), @@ -132,7 +132,7 @@ namespace MatterHackers.MatterControl.PrinterControls // Remove the HorizontalSpacer settingsRow.Children.Last().Close(); - extrusionRatioSlider = new SolidSlider(new Vector2(), sliderThumbWidth, minExtrutionRatio, maxExtrusionRatio, Orientation.Horizontal) + extrusionRatioSlider = new SolidSlider(new Vector2(), sliderThumbWidth, theme, minExtrutionRatio, maxExtrusionRatio, Orientation.Horizontal) { Name = "Extrusion Multiplier Slider", TotalWidthInPixels = sliderWidth, diff --git a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs index 6a038529e..9660223b2 100644 --- a/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs +++ b/MatterControlLib/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs @@ -259,7 +259,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections var validationTextWidget = new TextWidget(validationMessage, 0, 0, 10) { - TextColor = theme.Colors.PrimaryAccentColor, + TextColor = theme.PrimaryAccentColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }; diff --git a/MatterControlLib/SettingsManagement/ApplicationSettingsPage.cs b/MatterControlLib/SettingsManagement/ApplicationSettingsPage.cs index 5273fcd4f..6195a5063 100644 --- a/MatterControlLib/SettingsManagement/ApplicationSettingsPage.cs +++ b/MatterControlLib/SettingsManagement/ApplicationSettingsPage.cs @@ -233,7 +233,7 @@ namespace MatterHackers.MatterControl double sliderThumbWidth = 10 * GuiWidget.DeviceScale; double sliderWidth = 100 * GuiWidget.DeviceScale; - var textSizeSlider = new SolidSlider(new Vector2(), sliderThumbWidth, .7, 1.4) + var textSizeSlider = new SolidSlider(new Vector2(), sliderThumbWidth, theme, .7, 1.4) { Name = "Text Size Slider", Margin = new BorderDouble(5, 0), diff --git a/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs b/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs index ab83e92aa..20d7a51aa 100644 --- a/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs +++ b/MatterControlLib/SetupWizard/AndroidConnectDevicePage.cs @@ -94,7 +94,7 @@ namespace MatterHackers.MatterControl generalError = new TextWidget("", 0, 0, errorFontSize) { - TextColor = ActiveTheme.Instance.PrimaryAccentColor, + TextColor = theme.PrimaryAccentColor, HAnchor = HAnchor.Stretch, Visible = false, Margin = new BorderDouble(top: 20), diff --git a/MatterControlLib/SetupWizard/DialogPage.cs b/MatterControlLib/SetupWizard/DialogPage.cs index 6931d05a4..3d7fa736c 100644 --- a/MatterControlLib/SetupWizard/DialogPage.cs +++ b/MatterControlLib/SetupWizard/DialogPage.cs @@ -98,7 +98,7 @@ namespace MatterHackers.MatterControl this.AddChild(headerRow); - headerLabel = new TextWidget("Setup Wizard".Localize(), pointSize: 24, textColor: theme.Colors.PrimaryAccentColor) + headerLabel = new TextWidget("Setup Wizard".Localize(), pointSize: 24, textColor: theme.PrimaryAccentColor) { AutoExpandBoundsToText = true, EllipsisIfClipped = true, diff --git a/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs b/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs index 7de4dfb59..91baed307 100644 --- a/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs +++ b/MatterControlLib/SetupWizard/SetupWizardTroubleshooting.cs @@ -205,7 +205,7 @@ namespace MatterHackers.MatterControl errorText.AddChild( new TextWidget(CriteriaRow.ActiveErrorItem.ErrorText) { - TextColor = theme.Colors.PrimaryAccentColor + TextColor = theme.PrimaryAccentColor }); contentRow.AddChild(errorText);