diff --git a/ApplicationView/ThemeConfig.cs b/ApplicationView/ThemeConfig.cs index 283c42866..84464bdeb 100644 --- a/ApplicationView/ThemeConfig.cs +++ b/ApplicationView/ThemeConfig.cs @@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl public int FontSize12 { get; } = 12; public int FontSize14 { get; } = 14; - public int DefaultFontSize { get; } = 12; + public int DefaultFontSize { get; } = 11; internal int shortButtonHeight = 25; private int sideBarButtonWidth; @@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl commonOptions.PressedTextColor = theme.PrimaryTextColor; commonOptions.DisabledTextColor = theme.TertiaryBackgroundColor; commonOptions.Margin = new BorderDouble(14, 0); - commonOptions.FontSize = 11; + commonOptions.FontSize = this.DefaultFontSize; commonOptions.ImageSpacing = 8; commonOptions.BorderWidth = 0; commonOptions.FixedHeight = 32; diff --git a/ConfigurationPage/ApplicationSettings/SettingsItem.cs b/ConfigurationPage/ApplicationSettings/SettingsItem.cs index 552a7e0d2..f3e0cc2e9 100644 --- a/ConfigurationPage/ApplicationSettings/SettingsItem.cs +++ b/ConfigurationPage/ApplicationSettings/SettingsItem.cs @@ -36,6 +36,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage public SettingsItem (string text, Color textColor, GuiWidget settingsControls, GuiWidget optionalControls = null, ImageBuffer imageBuffer = null, bool enforceGutter = true) : base (FlowDirection.LeftToRight) { + var theme = ApplicationController.Instance.Theme; this.SettingsControl = settingsControls; this.HAnchor = HAnchor.Stretch; this.MinimumSize = new Vector2(0, 40); @@ -59,7 +60,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage }); } - this.AddChild(new TextWidget(text, textColor: textColor) + this.AddChild(new TextWidget(text, textColor: textColor, pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, VAnchor = VAnchor.Center, diff --git a/ControlElements/TextImageButtonFactory.cs b/ControlElements/TextImageButtonFactory.cs index d82ea85ad..65a1a9433 100644 --- a/ControlElements/TextImageButtonFactory.cs +++ b/ControlElements/TextImageButtonFactory.cs @@ -136,18 +136,12 @@ namespace MatterHackers.MatterControl public Button Generate(string label, double fixedWidth = -1) { - // Create button based on view container widget - var buttonViewWidget = new ButtonViewStates( - new TextImageWidget(label, normalFillColor, normalBorderColor, normalTextColor, borderWidth, Margin, null, fontSize: this.fontSize, height: this.FixedHeight, imageSpacing: ImageSpacing), - new TextImageWidget(label, hoverFillColor, hoverBorderColor, hoverTextColor, borderWidth, Margin, null, fontSize: this.fontSize, height: this.FixedHeight, imageSpacing: ImageSpacing), - new TextImageWidget(label, pressedFillColor, pressedBorderColor, pressedTextColor, borderWidth, Margin, null, fontSize: this.fontSize, height: this.FixedHeight, imageSpacing: ImageSpacing), - new TextImageWidget(label, disabledFillColor, disabledBorderColor, disabledTextColor, borderWidth, Margin, null, fontSize: this.fontSize, height: this.FixedHeight, imageSpacing: ImageSpacing) - ); + var theme = ApplicationController.Instance.Theme; - var textImageButton = new Button(0, 0, buttonViewWidget) + var button = new TextButton(label, theme) { - Margin = new BorderDouble(0), - Padding = new BorderDouble(0), + BackgroundColor = theme.MinimalShade, + VAnchor = VAnchor.Absolute }; // Allow fixedWidth parameter to override local .FixedWith property @@ -155,17 +149,17 @@ namespace MatterHackers.MatterControl { if (fixedWidth > 0) { - buttonViewWidget.Width = fixedWidth; - textImageButton.Width = fixedWidth; + button.HAnchor = HAnchor.Absolute; + button.Width = fixedWidth; } } else if (this.FixedWidth != 0) { //Override the width if requested - buttonViewWidget.Width = this.FixedWidth; - textImageButton.Width = this.FixedWidth; + button.HAnchor = HAnchor.Absolute; + button.Width = this.FixedWidth; } - return textImageButton; + return button; } private ButtonViewStates getButtonView(string label, ImageBuffer normalImage = null, ImageBuffer hoverImage = null, ImageBuffer pressedImage = null, ImageBuffer disabledImage = null) diff --git a/CustomWidgets/DockingTabControl.cs b/CustomWidgets/DockingTabControl.cs index b354283fb..26243da36 100644 --- a/CustomWidgets/DockingTabControl.cs +++ b/CustomWidgets/DockingTabControl.cs @@ -53,7 +53,6 @@ namespace MatterHackers.MatterControl.CustomWidgets private PrinterConfig printer; private ThemeConfig theme; - private ResizeContainer resizePage; public DockingTabControl(GuiWidget widgetTodockTo, DockSide dockSide, PrinterConfig printer) : base (FlowDirection.TopToBottom) @@ -62,6 +61,8 @@ namespace MatterHackers.MatterControl.CustomWidgets this.printer = printer; this.widgetTodockTo = widgetTodockTo; this.DockSide = dockSide; + this.BorderColor = theme.MinimalShade; + this.Border = new BorderDouble(left: 1); // Add dummy widget to ensure OnLoad fires this.AddChild(new GuiWidget(10, 10)); @@ -275,7 +276,6 @@ namespace MatterHackers.MatterControl.CustomWidgets }); settingsButtons.Add(settingsButton); - settingsButton.DebugShowBounds = true; settingsButton.PopupContent = resizeContainer; settingsButton.Click += (s, e) => diff --git a/CustomWidgets/SimpleButton.cs b/CustomWidgets/SimpleButton.cs index 006cbbe61..b819b25e8 100644 --- a/CustomWidgets/SimpleButton.cs +++ b/CustomWidgets/SimpleButton.cs @@ -244,7 +244,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.Padding = theme.ButtonFactory.Options.Margin; this.TextColor = textColor; - this.AddChild(textWidget = new TextWidget(text, pointSize: theme.ButtonFactory.Options.FontSize, textColor: textColor) + this.AddChild(textWidget = new TextWidget(text, pointSize: theme.DefaultFontSize, textColor: textColor) { HAnchor = HAnchor.Center, VAnchor = VAnchor.Center diff --git a/PartPreviewWindow/MaterialControls.cs b/PartPreviewWindow/MaterialControls.cs index f4f125575..6d0b70d4f 100644 --- a/PartPreviewWindow/MaterialControls.cs +++ b/PartPreviewWindow/MaterialControls.cs @@ -62,7 +62,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; this.AddChild(row); - var radioButton = new RadioButton(string.Format("{0} {1}", "Material".Localize(), extruderIndex + 1), textColor: theme.Colors.PrimaryTextColor); + var radioButton = new RadioButton(string.Format("{0} {1}", "Material".Localize(), extruderIndex + 1), textColor: theme.Colors.PrimaryTextColor, fontSize: theme.DefaultFontSize); materialButtons.Add(radioButton); radioButton.SiblingRadioButtonList = materialButtons; row.AddChild(radioButton); diff --git a/PartPreviewWindow/PopupMenu.cs b/PartPreviewWindow/PopupMenu.cs index 0ca30e08c..450a7db82 100644 --- a/PartPreviewWindow/PopupMenu.cs +++ b/PartPreviewWindow/PopupMenu.cs @@ -38,8 +38,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { public class PopupMenu : FlowLayoutWidget { - public static double PointSize { get; set; } = 12; - public static int GutterWidth { get; set; } = 35; private ThemeConfig theme; @@ -70,9 +68,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public MenuItem CreateMenuItem(string name, ImageBuffer icon = null) { - var textWidget = new TextWidget(name) + var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize) { - PointSize = PopupMenu.PointSize, Padding = MenuPadding, }; @@ -91,9 +88,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public MenuItem CreateBoolMenuItem(string name, Func getter, Action setter) { - var textWidget = new TextWidget(name) + var textWidget = new TextWidget(name, pointSize: theme.DefaultFontSize) { - PointSize = PopupMenu.PointSize, Padding = MenuPadding, }; diff --git a/PartPreviewWindow/SectionWidget.cs b/PartPreviewWindow/SectionWidget.cs index e710e6726..90e821a5f 100644 --- a/PartPreviewWindow/SectionWidget.cs +++ b/PartPreviewWindow/SectionWidget.cs @@ -23,7 +23,7 @@ namespace MatterHackers.MatterControl.CustomWidgets if (!string.IsNullOrEmpty(sectionTitle)) { // Add heading - var pointSize = (headingPointSize) == -1 ? theme.H1PointSize : headingPointSize; + var pointSize = (headingPointSize) == -1 ? theme.DefaultFontSize : headingPointSize; GuiWidget heading; diff --git a/PartPreviewWindow/SelectedObjectPanel.cs b/PartPreviewWindow/SelectedObjectPanel.cs index 8b874411d..c0d13e59e 100644 --- a/PartPreviewWindow/SelectedObjectPanel.cs +++ b/PartPreviewWindow/SelectedObjectPanel.cs @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; this.AddChild(firstPanel); - firstPanel.AddChild(itemName = new TextWidget("", textColor: ActiveTheme.Instance.PrimaryTextColor) + firstPanel.AddChild(itemName = new TextWidget("", textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, EllipsisIfClipped = true, diff --git a/PartPreviewWindow/View3D/SideBar/ScaleControl.cs b/PartPreviewWindow/View3D/SideBar/ScaleControl.cs index bd3a9fd09..169d7b282 100644 --- a/PartPreviewWindow/View3D/SideBar/ScaleControl.cs +++ b/PartPreviewWindow/View3D/SideBar/ScaleControl.cs @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.AddChild(new ScaleOptionsPanel(this, theme)); // Going to use this in the scaling controls, create it early. - usePercents = new CheckBox("Use Percents".Localize(), textColor: theme.Colors.PrimaryTextColor); + usePercents = new CheckBox("Use Percents".Localize(), textColor: theme.Colors.PrimaryTextColor, textSize: theme.DefaultFontSize); // add in the dimensions this.AddChild(CreateAxisScalingControl("x".ToUpper(), 0)); @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.AddChild(CreateAxisScalingControl("z".ToUpper(), 2)); // lock ratio checkbox - uniformScale = new CheckBox("Lock Ratio".Localize(), textColor: theme.Colors.PrimaryTextColor); + uniformScale = new CheckBox("Lock Ratio".Localize(), textColor: theme.Colors.PrimaryTextColor, textSize: theme.DefaultFontSize); uniformScale.Margin = new BorderDouble(5, 3); uniformScale.Checked = true; uniformScale.CheckedStateChanged += (s, e) => @@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow Padding = new BorderDouble(5, 3) }; - var sizeDescription = new TextWidget("{0}:".FormatWith(axis), textColor: theme.Colors.PrimaryTextColor) + var sizeDescription = new TextWidget("{0}:".FormatWith(axis), textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) { VAnchor = VAnchor.Center }; @@ -159,7 +159,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow leftToRight.AddChild(sizeDisplay[axisIndex]); - var units = new TextWidget("mm".FormatWith(axis), textColor: theme.Colors.PrimaryTextColor) + var units = new TextWidget("mm".FormatWith(axis), textColor: theme.Colors.PrimaryTextColor, pointSize: theme.DefaultFontSize) { VAnchor = VAnchor.Center }; diff --git a/PrinterControls/ControlWidgets/AdjustmentControls.cs b/PrinterControls/ControlWidgets/AdjustmentControls.cs index 77546fa9f..fa2f63e66 100644 --- a/PrinterControls/ControlWidgets/AdjustmentControls.cs +++ b/PrinterControls/ControlWidgets/AdjustmentControls.cs @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.PrinterControls VAnchor = VAnchor.Fit }; - var feedRateDescription = new TextWidget("Speed Multiplier".Localize()) + var feedRateDescription = new TextWidget("Speed Multiplier".Localize(), pointSize: theme.DefaultFontSize) { MinimumSize = new Vector2(140, 0) * GuiWidget.DeviceScale, TextColor = ActiveTheme.Instance.PrimaryTextColor, @@ -132,7 +132,7 @@ namespace MatterHackers.MatterControl.PrinterControls VAnchor = VAnchor.Fit }; - var extrusionDescription = new TextWidget("Extrusion Multiplier".Localize()) + var extrusionDescription = new TextWidget("Extrusion Multiplier".Localize(), pointSize: theme.DefaultFontSize) { MinimumSize = new Vector2(140, 0) * GuiWidget.DeviceScale, TextColor = ActiveTheme.Instance.PrimaryTextColor, diff --git a/PrinterControls/ControlWidgets/MovementControls.cs b/PrinterControls/ControlWidgets/MovementControls.cs index 775c0b0a8..fcc091015 100644 --- a/PrinterControls/ControlWidgets/MovementControls.cs +++ b/PrinterControls/ControlWidgets/MovementControls.cs @@ -212,14 +212,16 @@ namespace MatterHackers.MatterControl.PrinterControls private FlowLayoutWidget GetHWDestinationBar() { - FlowLayoutWidget hwDestinationBar = new FlowLayoutWidget(); - hwDestinationBar.HAnchor = HAnchor.Stretch; - hwDestinationBar.Margin = new BorderDouble(top: 8); - hwDestinationBar.Padding = 0; + var hwDestinationBar = new FlowLayoutWidget + { + HAnchor = HAnchor.Stretch, + Margin = new BorderDouble(top: 8), + Padding = 0 + }; - TextWidget xPosition = new TextWidget("X: 0.0 ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor); - TextWidget yPosition = new TextWidget("Y: 0.0 ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor); - TextWidget zPosition = new TextWidget("Z: 0.0 ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor); + 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); hwDestinationBar.AddChild(xPosition); hwDestinationBar.AddChild(yPosition); @@ -301,7 +303,7 @@ namespace MatterHackers.MatterControl.PrinterControls this.AddChild(zOffsetStreamContainer); double zoffset = printerSettings.GetValue(SettingsKey.baby_step_z_offset); - zOffsetStreamDisplay = new TextWidget(zoffset.ToString("0.##")) + zOffsetStreamDisplay = new TextWidget(zoffset.ToString("0.##"), pointSize: theme.DefaultFontSize) { AutoExpandBoundsToText = true, TextColor = ActiveTheme.Instance.PrimaryTextColor, diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index e7daeeacc..20e512ecd 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit e7daeeaccf8e8257bc4e6ef7623805df965e232a +Subproject commit 20e512ecddb0612aa1ca9bbfe512a13401093f85