Remove helper method

This commit is contained in:
John Lewin 2018-05-06 07:57:15 -07:00
parent d2de4cbabc
commit 9aa8bb80b1
4 changed files with 13 additions and 14 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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) =>

View file

@ -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)