From 13cc147dfe658bdaa42216670b26ca1bf145ec0e Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 12 Jan 2018 12:57:53 -0800 Subject: [PATCH] Caller specified pointSize for DropDownLists --- AboutPage/CheckForUpdatesPage.cs | 2 +- ActionBar/PrinterSelector.cs | 3 ++- ActionBar/TemperatureWidgetBed.cs | 2 +- ActionBar/TemperatureWidgetExtruder.cs | 2 +- .../ApplicationSettingsView.cs | 2 +- CustomWidgets/ConfigurePrinterWidget.cs | 2 +- PartPreviewWindow/PlusTab/PlusTabPage.cs | 2 +- PartPreviewWindow/View3D/GridOptionsPanel.cs | 2 +- .../View3D/PrinterBar/PrintPopupMenu.cs | 2 +- .../View3D/SideBar/ScaleControl.cs | 2 +- PrinterControls/MacroDetailPage.cs | 16 ++++++++------ .../PrinterConnections/PrinterChooser.cs | 10 ++------- SlicerConfiguration/PresetSelectorWidget.cs | 22 +++++++++---------- SlicerConfiguration/SliceSettingsWidget.cs | 14 +++++++----- SlicerConfiguration/UIFields/ComPortField.cs | 7 +++--- .../UIFields/DropMenuWrappedField.cs | 2 +- SlicerConfiguration/UIFields/IpAddessField.cs | 12 +++++----- SlicerConfiguration/UIFields/ListField.cs | 3 ++- Submodules/agg-sharp | 2 +- .../MatterControl/SliceSettingsFieldTests.cs | 2 +- 20 files changed, 57 insertions(+), 54 deletions(-) diff --git a/AboutPage/CheckForUpdatesPage.cs b/AboutPage/CheckForUpdatesPage.cs index 721b0a4bb..26c550e2a 100644 --- a/AboutPage/CheckForUpdatesPage.cs +++ b/AboutPage/CheckForUpdatesPage.cs @@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.AboutPage UserSettings.Instance.set(UserSettingsKey.UpdateFeedType, "release"); } - var releaseOptionsDropList = new DropDownList("Development", theme.Colors.PrimaryTextColor, maxHeight: 200) + var releaseOptionsDropList = new DropDownList("Development", theme.Colors.PrimaryTextColor, maxHeight: 200, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Fit }; diff --git a/ActionBar/PrinterSelector.cs b/ActionBar/PrinterSelector.cs index d8e4a2615..9343a78fd 100644 --- a/ActionBar/PrinterSelector.cs +++ b/ActionBar/PrinterSelector.cs @@ -42,7 +42,8 @@ namespace MatterHackers.MatterControl private EventHandler unregisterEvents; int lastSelectedIndex = -1; - public PrinterSelector() : base("Printers".Localize() + "... ", ActiveTheme.Instance.PrimaryTextColor) + public PrinterSelector(ThemeConfig theme) + : base("Printers".Localize() + "... ", theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) { Rebuild(); diff --git a/ActionBar/TemperatureWidgetBed.cs b/ActionBar/TemperatureWidgetBed.cs index bbba725fd..60bf7e48e 100644 --- a/ActionBar/TemperatureWidgetBed.cs +++ b/ActionBar/TemperatureWidgetBed.cs @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.ActionBar var settingsContext = new SettingsContext(printer, null, NamedSettingsLayers.All); var settingsData = SliceSettingsOrganizer.Instance.GetSettingsData(SettingsKey.bed_temperature); - var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, ref tabIndex); + var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, ApplicationController.Instance.Theme, ref tabIndex); container.AddChild(row); // add in the temp graph diff --git a/ActionBar/TemperatureWidgetExtruder.cs b/ActionBar/TemperatureWidgetExtruder.cs index 112f92cb2..f516c67d7 100644 --- a/ActionBar/TemperatureWidgetExtruder.cs +++ b/ActionBar/TemperatureWidgetExtruder.cs @@ -246,7 +246,7 @@ namespace MatterHackers.MatterControl.ActionBar var settingsContext = new SettingsContext(printer, null, NamedSettingsLayers.All); // TODO: make this be for the correct extruder var settingsData = SliceSettingsOrganizer.Instance.GetSettingsData(TemperatureKey); - var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, ref tabIndex); + var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, ApplicationController.Instance.Theme, ref tabIndex); container.AddChild(row); diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 8aefdcc86..07b9f9d3a 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -161,7 +161,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage #if !__ANDROID__ { // ThumbnailRendering - var thumbnailsModeDropList = new DropDownList("", ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200) + var thumbnailsModeDropList = new DropDownList("", ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200, pointSize: ApplicationController.Instance.Theme.DefaultFontSize) { TextColor = menuTextColor, }; diff --git a/CustomWidgets/ConfigurePrinterWidget.cs b/CustomWidgets/ConfigurePrinterWidget.cs index 184bd65e6..3458f7af4 100644 --- a/CustomWidgets/ConfigurePrinterWidget.cs +++ b/CustomWidgets/ConfigurePrinterWidget.cs @@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl : base(FlowDirection.TopToBottom) { int tabIndex = 0; - var rowItem = sliceSettingsWidget.CreateItemRow(SliceSettingsOrganizer.SettingsData["printer_name"], ref tabIndex); + var rowItem = sliceSettingsWidget.CreateItemRow(SliceSettingsOrganizer.SettingsData["printer_name"],ref tabIndex, theme); var firstChild = rowItem.Children.FirstOrDefault(); firstChild.HAnchor = HAnchor.Absolute; diff --git a/PartPreviewWindow/PlusTab/PlusTabPage.cs b/PartPreviewWindow/PlusTab/PlusTabPage.cs index 09c434203..f4bb77e15 100644 --- a/PartPreviewWindow/PlusTab/PlusTabPage.cs +++ b/PartPreviewWindow/PlusTab/PlusTabPage.cs @@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab var existingPrinterSection = CreateSection(leftContent, "Open Existing".Localize() + ":"); - var printerSelector = new PrinterSelector() + var printerSelector = new PrinterSelector(theme) { Margin = new BorderDouble(left: 15) }; diff --git a/PartPreviewWindow/View3D/GridOptionsPanel.cs b/PartPreviewWindow/View3D/GridOptionsPanel.cs index 834cd00f4..4df79c5b9 100644 --- a/PartPreviewWindow/View3D/GridOptionsPanel.cs +++ b/PartPreviewWindow/View3D/GridOptionsPanel.cs @@ -57,7 +57,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { 5, "5" }, }; - var dropDownList = new DropDownList("Custom", ActiveTheme.Instance.PrimaryTextColor, Direction.Down) + var dropDownList = new DropDownList("Custom", ActiveTheme.Instance.PrimaryTextColor, Direction.Down, ApplicationController.Instance.Theme.DefaultFontSize) { TextColor = Color.Black, Margin = new BorderDouble(35, 15, 35, 5), diff --git a/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs b/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs index 0b03d2dd3..b9fa645f2 100644 --- a/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs +++ b/PartPreviewWindow/View3D/PrinterBar/PrintPopupMenu.cs @@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow foreach (var key in new[] { "layer_height", "fill_density", "support_material", "create_raft", "spiral_vase", "layer_to_pause" }) { var settingsData = SliceSettingsOrganizer.Instance.GetSettingsData(key); - var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, ref tabIndex); + var row = SliceSettingsWidget.CreateItemRow(settingsData, settingsContext, printer, Color.Black, theme, ref tabIndex); optionsPanel.AddChild(row); } diff --git a/PartPreviewWindow/View3D/SideBar/ScaleControl.cs b/PartPreviewWindow/View3D/SideBar/ScaleControl.cs index 169d7b282..52fa1e68b 100644 --- a/PartPreviewWindow/View3D/SideBar/ScaleControl.cs +++ b/PartPreviewWindow/View3D/SideBar/ScaleControl.cs @@ -207,7 +207,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { 10, "cm to mm (10)"}, }; - var dropDownList = new DropDownList("Scale".Localize(), theme.Colors.PrimaryTextColor, Direction.Down) + var dropDownList = new DropDownList("Scale".Localize(), theme.Colors.PrimaryTextColor, Direction.Down, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Left }; diff --git a/PrinterControls/MacroDetailPage.cs b/PrinterControls/MacroDetailPage.cs index 531481be4..3ae7d28af 100644 --- a/PrinterControls/MacroDetailPage.cs +++ b/PrinterControls/MacroDetailPage.cs @@ -46,6 +46,8 @@ namespace MatterHackers.MatterControl public MacroDetailPage(GCodeMacro gcodeMacro, PrinterSettings printerSettings) { + var theme = ApplicationController.Instance.Theme; + // Form validation fields MHTextEditWidget macroNameInput; MHTextEditWidget macroCommandInput; @@ -61,7 +63,7 @@ namespace MatterHackers.MatterControl contentRow.AddChild(new TextWidget("Macro Name".Localize() + ":", 0, 0, 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 0, 0, 1) }); @@ -73,14 +75,14 @@ namespace MatterHackers.MatterControl contentRow.AddChild(macroNameError = new TextWidget("Give the macro a name".Localize() + ".", 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }); contentRow.AddChild(new TextWidget("Macro Commands".Localize() + ":", 0, 0, 12) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, HAnchor = HAnchor.Stretch, Margin = new BorderDouble(0, 0, 0, 1) }); @@ -96,7 +98,7 @@ namespace MatterHackers.MatterControl contentRow.AddChild(macroCommandError = new TextWidget("This should be in 'G-Code'".Localize() + ".", 0, 0, 10) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, HAnchor = HAnchor.Stretch, Margin = elementMargin }); @@ -109,13 +111,13 @@ namespace MatterHackers.MatterControl container.AddChild(new TextWidget("Where to show this macro:") { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, VAnchor = VAnchor.Center }); - var macroUiLocation = new DropDownList("Default", ActiveTheme.Instance.PrimaryTextColor, Direction.Up) + var macroUiLocation = new DropDownList("Default", theme.Colors.PrimaryTextColor, Direction.Up, pointSize: theme.DefaultFontSize) { - TextColor = ActiveTheme.Instance.PrimaryTextColor, + TextColor = theme.Colors.PrimaryTextColor, Margin = new BorderDouble(5, 0), VAnchor = VAnchor.Center }; diff --git a/PrinterControls/PrinterConnections/PrinterChooser.cs b/PrinterControls/PrinterConnections/PrinterChooser.cs index bb2d4f105..114440b92 100644 --- a/PrinterControls/PrinterConnections/PrinterChooser.cs +++ b/PrinterControls/PrinterConnections/PrinterChooser.cs @@ -27,15 +27,9 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ -using MatterHackers.Agg.Platform; -using MatterHackers.Agg.UI; -using MatterHackers.Localizations; using System.Collections.Generic; -using MatterHackers.MatterControl.SettingsManagement; -using System.IO; -using System.Linq; using MatterHackers.Agg; -using System; +using MatterHackers.Agg.UI; namespace MatterHackers.MatterControl { @@ -44,7 +38,7 @@ namespace MatterHackers.MatterControl private List> listSource; public BoundDropList(string noSelectionString, int maxHeight = 0) - : base(noSelectionString, ActiveTheme.Instance.PrimaryTextColor, maxHeight: maxHeight) + : base(noSelectionString, ActiveTheme.Instance.PrimaryTextColor, maxHeight: maxHeight, pointSize: ApplicationController.Instance.Theme.DefaultFontSize) { } diff --git a/SlicerConfiguration/PresetSelectorWidget.cs b/SlicerConfiguration/PresetSelectorWidget.cs index fe47319a0..853eea29c 100644 --- a/SlicerConfiguration/PresetSelectorWidget.cs +++ b/SlicerConfiguration/PresetSelectorWidget.cs @@ -35,7 +35,6 @@ using MatterHackers.Agg; using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; using MatterHackers.Localizations; -using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.SlicerConfiguration @@ -46,6 +45,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration private string defaultMenuItemText = "- none -".Localize(); private Button editButton; private NamedSettingsLayers layerType; + private ThemeConfig theme; private PrinterConfig printer; private GuiWidget pullDownContainer; private EventHandler unregisterEvents; @@ -55,9 +55,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public PresetSelectorWidget(PrinterConfig printer, string label, Color accentColor, NamedSettingsLayers layerType, bool whiteBackground = false) : base(FlowDirection.TopToBottom) { + theme = ApplicationController.Instance.Theme; + this.printer = printer; this.whiteBackground = whiteBackground; - Name = label; + this.Name = label; ActiveSliceSettings.MaterialPresetChanged += ActiveSliceSettings_MaterialPresetChanged; @@ -75,7 +77,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.HAnchor = HAnchor.Stretch; this.VAnchor = VAnchor.Fit; - this.BackgroundColor = ActiveTheme.Instance.TertiaryBackgroundColor; + this.BackgroundColor = theme.Colors.TertiaryBackgroundColor; GuiWidget accentBar = new GuiWidget(7, 3) { @@ -84,9 +86,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }; // Section Label - this.AddChild(new TextWidget(label) + this.AddChild(new TextWidget(label, pointSize: theme.DefaultFontSize) { - TextColor = whiteBackground ? Color.Black : ActiveTheme.Instance.PrimaryTextColor, + TextColor = whiteBackground ? Color.Black : theme.Colors.PrimaryTextColor, HAnchor = HAnchor.Left, Margin = new BorderDouble(12, 3, 0, 6) }); @@ -216,10 +218,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public override void OnClosed(ClosedEventArgs e) { ActiveSliceSettings.MaterialPresetChanged -= ActiveSliceSettings_MaterialPresetChanged; - if (unregisterEvents != null) - { - unregisterEvents(this, null); - } + unregisterEvents?.Invoke(this, null); + base.OnClosed(e); } @@ -230,11 +230,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration private DropDownList CreateDropdown() { - var dropDownList = new DropDownList(defaultMenuItemText, ActiveTheme.Instance.PrimaryTextColor, maxHeight: 300, useLeftIcons: true) + var dropDownList = new DropDownList(defaultMenuItemText, theme.Colors.PrimaryTextColor, maxHeight: 300, useLeftIcons: true, pointSize: theme.DefaultFontSize) { HAnchor = HAnchor.Stretch, MenuItemsPadding = new BorderDouble(10, 7, 7, 7), - TextColor = whiteBackground ? Color.Black : ActiveTheme.Instance.PrimaryTextColor, + TextColor = whiteBackground ? Color.Black : theme.Colors.PrimaryTextColor, }; dropDownList.Name = layerType.ToString() + " DropDown List"; diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index a0e4c5a31..e78bda278 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -310,7 +310,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration && settingShouldBeShown) { topToBottomSettings.AddChild( - CreateItemRow(settingData, ref tabIndexForItem)); + CreateItemRow(settingData, ref tabIndexForItem, theme)); topToBottomSettings.AddChild(new HorizontalLine(20) { @@ -430,12 +430,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return dataArea; } - internal GuiWidget CreateItemRow(SliceSettingData settingData, ref int tabIndexForItem) + internal GuiWidget CreateItemRow(SliceSettingData settingData, ref int tabIndexForItem, ThemeConfig theme) { - return CreateItemRow(settingData, settingsContext, printer, ActiveTheme.Instance.PrimaryTextColor, ref tabIndexForItem, allUiFields); + return CreateItemRow(settingData, settingsContext, printer, theme.Colors.PrimaryTextColor, theme, ref tabIndexForItem, allUiFields); } - public static GuiWidget CreateItemRow(SliceSettingData settingData, SettingsContext settingsContext, PrinterConfig printer, Color textColor, ref int tabIndexForItem, Dictionary fieldCache = null) + public static GuiWidget CreateItemRow(SliceSettingData settingData, SettingsContext settingsContext, PrinterConfig printer, Color textColor, ThemeConfig theme, ref int tabIndexForItem, Dictionary fieldCache = null) { string sliceSettingValue = settingsContext.GetValue(settingData.SlicerConfigName); @@ -536,7 +536,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration sliceSettingValue = printer.Settings.Helpers.ComPort(); - uiField = new ComPortField(printer); + uiField = new ComPortField(printer, theme); uiField.ValueChanged += (s, e) => { if (e.UserInitiated) @@ -698,10 +698,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public static GuiWidget CreateQuickMenu(SliceSettingData settingData, SettingsContext settingsContext, GuiWidget content, InternalTextEditWidget internalTextWidget) { + var theme = ApplicationController.Instance.Theme; + string sliceSettingValue =settingsContext.GetValue(settingData.SlicerConfigName); FlowLayoutWidget totalContent = new FlowLayoutWidget(); - DropDownList selectableOptions = new DropDownList("Custom", ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200); + DropDownList selectableOptions = new DropDownList("Custom", theme.Colors.PrimaryTextColor, maxHeight: 200, pointSize: theme.DefaultFontSize); selectableOptions.Margin = new BorderDouble(0, 0, 10, 0); foreach (QuickMenuNameValue nameValue in settingData.QuickMenuSettings) diff --git a/SlicerConfiguration/UIFields/ComPortField.cs b/SlicerConfiguration/UIFields/ComPortField.cs index c7271e9ba..db3c3ada6 100644 --- a/SlicerConfiguration/UIFields/ComPortField.cs +++ b/SlicerConfiguration/UIFields/ComPortField.cs @@ -39,11 +39,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public class ComPortField : UIField { private DropDownList dropdownList; - + private ThemeConfig theme; private PrinterConfig printer; - public ComPortField(PrinterConfig printer) + public ComPortField(PrinterConfig printer, ThemeConfig theme) { + this.theme = theme; this.printer = printer; } @@ -59,7 +60,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration // bind to a context that will place it in the SliceSetting view but it binds its values to a machine // specific dictionary key that is not exposed in the UI. At runtime we lookup and store to '_com_port' // ensuring that a single printer can be shared across different devices and we'll select the correct com port in each case - dropdownList = new DropDownList("None".Localize(), ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200) + dropdownList = new DropDownList("None".Localize(), ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200, pointSize: theme.DefaultFontSize) { ToolTipText = this.HelpText, Margin = new BorderDouble(), diff --git a/SlicerConfiguration/UIFields/DropMenuWrappedField.cs b/SlicerConfiguration/UIFields/DropMenuWrappedField.cs index 2cde4a370..166609eaa 100644 --- a/SlicerConfiguration/UIFields/DropMenuWrappedField.cs +++ b/SlicerConfiguration/UIFields/DropMenuWrappedField.cs @@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { var totalContent = new FlowLayoutWidget(); - var selectableOptions = new DropDownList("Custom", textColor, maxHeight: 200); + var selectableOptions = new DropDownList("Custom", textColor, maxHeight: 200, pointSize: ApplicationController.Instance.Theme.DefaultFontSize); selectableOptions.Margin = new BorderDouble(0, 0, 10, 0); foreach (QuickMenuNameValue nameValue in settingData.QuickMenuSettings) diff --git a/SlicerConfiguration/UIFields/IpAddessField.cs b/SlicerConfiguration/UIFields/IpAddessField.cs index 31d52fc71..789db6af3 100644 --- a/SlicerConfiguration/UIFields/IpAddessField.cs +++ b/SlicerConfiguration/UIFields/IpAddessField.cs @@ -30,19 +30,21 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { EventHandler unregisterEvents = null; + var theme = ApplicationController.Instance.Theme; + base.Initialize(tabIndex); bool canChangeComPort = !printer.Connection.PrinterIsConnected && printer.Connection.CommunicationState != CommunicationStates.AttemptingToConnect; //This setting defaults to Manual var selectedMachine = printer.Settings.GetValue(SettingsKey.selector_ip_address); - dropdownList = new DropDownList(selectedMachine, ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200) + dropdownList = new DropDownList(selectedMachine, theme.Colors.PrimaryTextColor, maxHeight: 200, pointSize: theme.DefaultFontSize) { ToolTipText = HelpText, Margin = new BorderDouble(), TabIndex = tabIndex, Enabled = canChangeComPort, - TextColor = canChangeComPort ? ActiveTheme.Instance.PrimaryTextColor : new Color(ActiveTheme.Instance.PrimaryTextColor, 150), - BorderColor = canChangeComPort ? ActiveTheme.Instance.SecondaryTextColor : new Color(ActiveTheme.Instance.SecondaryTextColor, 150), + TextColor = canChangeComPort ? theme.Colors.PrimaryTextColor : new Color(theme.Colors.PrimaryTextColor, 150), + BorderColor = canChangeComPort ? theme.Colors.SecondaryTextColor : new Color(theme.Colors.SecondaryTextColor, 150), }; @@ -60,8 +62,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { canChangeComPort = !printer.Connection.PrinterIsConnected && printer.Connection.CommunicationState != CommunicationStates.AttemptingToConnect; dropdownList.Enabled = canChangeComPort; - dropdownList.TextColor = canChangeComPort ? ActiveTheme.Instance.PrimaryTextColor : new Color(ActiveTheme.Instance.PrimaryTextColor, 150); - dropdownList.BorderColor = canChangeComPort ? ActiveTheme.Instance.SecondaryTextColor : new Color(ActiveTheme.Instance.SecondaryTextColor, 150); + dropdownList.TextColor = canChangeComPort ? theme.Colors.PrimaryTextColor : new Color(theme.Colors.PrimaryTextColor, 150); + dropdownList.BorderColor = canChangeComPort ? theme.Colors.SecondaryTextColor : new Color(theme.Colors.SecondaryTextColor, 150); }, ref unregisterEvents); // Release event listener on close diff --git a/SlicerConfiguration/UIFields/ListField.cs b/SlicerConfiguration/UIFields/ListField.cs index 8f5657ef7..608b311f1 100644 --- a/SlicerConfiguration/UIFields/ListField.cs +++ b/SlicerConfiguration/UIFields/ListField.cs @@ -43,7 +43,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public override void Initialize(int tabIndex) { - dropdownList = new DropDownList("None".Localize(), ActiveTheme.Instance.PrimaryTextColor, maxHeight: 200) + var theme = ApplicationController.Instance.Theme; + dropdownList = new DropDownList("None".Localize(), theme.Colors.PrimaryTextColor, maxHeight: 200, pointSize: theme.DefaultFontSize) { ToolTipText = this.HelpText, TabIndex = tabIndex, diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index c42218762..f3461d676 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit c42218762da3a066c82049de13a496b1af5c4166 +Subproject commit f3461d6760b2f460c25d6ef924d5f87f83835876 diff --git a/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs b/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs index 8f199222a..634a11bec 100644 --- a/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/SliceSettingsFieldTests.cs @@ -277,7 +277,7 @@ namespace MatterControl.Tests.MatterControl AggContext.StaticData = new FileSystemStaticData(TestContext.CurrentContext.ResolveProjectPath(4, "StaticData")); MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4)); - var field = new ComPortField(new PrinterConfig(PrinterSettings.Empty)); + var field = new ComPortField(new PrinterConfig(PrinterSettings.Empty), new ThemeConfig()); await ValidateAgainstValueMap( field,