Making static data compile time and universal

This commit is contained in:
LarsBrubaker 2020-11-25 07:39:36 -08:00
parent 0fd5b7a0f9
commit 506f2b273f
141 changed files with 13671 additions and 355 deletions

View file

@ -322,7 +322,7 @@ namespace MatterHackers.MatterControl
static CalibrationPad()
{
activeIcon = AggContext.StaticData.LoadIcon("fa-check_16.png", 16, 16, true);
activeIcon = StaticData.Instance.LoadIcon("fa-check_16.png", 16, 16, true);
inactiveIcon = new ImageBuffer(16, 16);
}

View file

@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
string imageFile = this.ControlIsPinned ? "Pushpin_16x.png" : "PushpinUnpin_16x.png";
var pinTabButton = new IconButton(AggContext.StaticData.LoadIcon(imageFile, 16, 16, theme.InvertIcons), theme)
var pinTabButton = new IconButton(StaticData.Instance.LoadIcon(imageFile, 16, 16, theme.InvertIcons), theme)
{
Name = "Pin Settings Button"
};

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.ActionArea.VAnchor = VAnchor.Stretch;
this.ActionArea.MinimumSize = new Vector2(0, titleText.Height);
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
var editButton = new IconButton(StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = editToolTipText ?? "Edit".Localize(),
Name = helpArticle.Name + " Edit"

View file

@ -41,7 +41,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
public InlineListItemEdit(string title, ThemeConfig theme, string automationName, bool boldFont = false)
: base(title, theme, automationName, boldFont)
{
var removeButton = new IconButton(AggContext.StaticData.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
var removeButton = new IconButton(StaticData.Instance.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Delete".Localize(),
Visible = true,

View file

@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.ActionArea.VAnchor = VAnchor.Stretch;
this.ActionArea.MinimumSize = new Vector2(0, titleText.Height);
saveButton = new IconButton(AggContext.StaticData.LoadIcon("fa-save_16.png", 16, 16, theme.InvertIcons), theme)
saveButton = new IconButton(StaticData.Instance.LoadIcon("fa-save_16.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Save".Localize(),
Visible = false,
@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
rightPanel = new FlowLayoutWidget();
var icon = editable ? AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons) : new ImageBuffer(16, 16);
var icon = editable ? StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons) : new ImageBuffer(16, 16);
editButton = new IconButton(icon, theme)
{

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
this.CloseAllChildren();
var upbutton = new IconButton(AggContext.StaticData.LoadIcon(Path.Combine("Library", "upfolder_20.png"), 20, 20, theme.InvertIcons), theme)
var upbutton = new IconButton(StaticData.Instance.LoadIcon(Path.Combine("Library", "upfolder_20.png"), 20, 20, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Fit | VAnchor.Center,
Enabled = currentContainer.Parent != null,

View file

@ -505,8 +505,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
public TreeExpandWidget(ThemeConfig theme)
{
arrowRight = AggContext.StaticData.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = AggContext.StaticData.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
arrowRight = StaticData.Instance.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = StaticData.Instance.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
placeholder = new ImageBuffer(16, 16);
this.Margin = new BorderDouble(right: 4);