diff --git a/ControlElements/TextImageButtonFactory.cs b/ControlElements/TextImageButtonFactory.cs index 501cef798..1e9632649 100644 --- a/ControlElements/TextImageButtonFactory.cs +++ b/ControlElements/TextImageButtonFactory.cs @@ -75,11 +75,6 @@ namespace MatterHackers.MatterControl private double FixedHeight => Options.FixedHeight; private double ImageSpacing => Options.ImageSpacing; - public GuiWidget GenerateIconButton(ImageBuffer icon) - { - return new IconButton(icon, ApplicationController.Instance.Theme); - } - public CheckBox GenerateCheckBoxButton(string label, ImageBuffer normalImage, ImageBuffer normalToPressedImage = null, ImageBuffer pressedImage = null, ImageBuffer pressedToNormalImage = null, string pressedLabel = null) { if (pressedImage == null) pressedImage = normalImage; diff --git a/CustomWidgets/DockingTabControl.cs b/CustomWidgets/DockingTabControl.cs index 8d4d11b9f..54c70a774 100644 --- a/CustomWidgets/DockingTabControl.cs +++ b/CustomWidgets/DockingTabControl.cs @@ -120,10 +120,11 @@ namespace MatterHackers.MatterControl.CustomWidgets private GuiWidget CreatePinButton() { string imageFile = this.ControlIsPinned ? "Pushpin_16x.png" : "PushpinUnpin_16x.png"; - var icon = AggContext.StaticData.LoadIcon(imageFile, 16, 16, theme.InvertIcons); - var imageWidget = theme.ButtonFactory.GenerateIconButton(icon); - imageWidget.Name = "Pin Settings Button"; + var imageWidget = new IconButton(AggContext.StaticData.LoadIcon(imageFile, 16, 16, theme.InvertIcons), theme) + { + Name = "Pin Settings Button" + }; imageWidget.Click += (s, e) => { this.ControlIsPinned = !this.ControlIsPinned; diff --git a/PartPreviewWindow/RunningTaskRow.cs b/PartPreviewWindow/RunningTaskRow.cs index 73291f24a..7f9a35248 100644 --- a/PartPreviewWindow/RunningTaskRow.cs +++ b/PartPreviewWindow/RunningTaskRow.cs @@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; topRow.AddChild(resumeButton); - var stopButton = theme.ButtonFactory.GenerateIconButton(AggContext.StaticData.LoadIcon("fa-stop_12.png", theme.InvertIcons)); + var stopButton = new IconButton(AggContext.StaticData.LoadIcon("fa-stop_12.png", theme.InvertIcons), theme); stopButton.Margin = theme.ButtonSpacing; stopButton.Name = "Stop Task Button"; stopButton.Click += (s, e) => diff --git a/SlicerConfiguration/PresetSelectorWidget.cs b/SlicerConfiguration/PresetSelectorWidget.cs index b861e56d4..3a603a719 100644 --- a/SlicerConfiguration/PresetSelectorWidget.cs +++ b/SlicerConfiguration/PresetSelectorWidget.cs @@ -36,6 +36,7 @@ using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; using MatterHackers.Agg.VertexSource; using MatterHackers.Localizations; +using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.SlicerConfiguration @@ -104,11 +105,13 @@ namespace MatterHackers.MatterControl.SlicerConfiguration Name = "Preset Pulldown Container" }; - editButton = theme.ButtonFactory.GenerateIconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons)); - editButton.ToolTipText = "Edit Selected Setting".Localize(); - editButton.Enabled = DropDownList.SelectedIndex != -1; - editButton.VAnchor = VAnchor.Center; - editButton.Margin = new BorderDouble(left: 6); + editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme) + { + ToolTipText = "Edit Selected Setting".Localize(), + Enabled = DropDownList.SelectedIndex != -1, + VAnchor = VAnchor.Center, + Margin = new BorderDouble(left: 6) + }; editButton.Click += (sender, e) => { if (layerType == NamedSettingsLayers.Material)