Move bed colors into theme

- Issue MatterHackers/MCCentral#5325
Migrate to themed bed colors
This commit is contained in:
John Lewin 2019-04-13 01:54:01 -07:00
parent 3a3e5f9155
commit 92a3693772
4 changed files with 58 additions and 25 deletions

View file

@ -202,6 +202,32 @@ namespace MatterHackers.MatterControl
public Color BorderColor { get; set; }
public Color BorderColor40 { get; set; }
public Color BorderColor20 { get; set; }
internal void EnsureDefaults()
{
if (this.BedColor == Color.Transparent)
{
this.BedColor = this.ResolveColor(this.BackgroundColor, Color.Gray.WithAlpha(60));
}
if (this.UnderBedColor == Color.Transparent)
{
this.UnderBedColor = new Color(this.BedColor, this.BedColor.alpha / 4);
}
if (this.BedGridColors == null
|| (this.BedGridColors.Line == Color.Transparent && this.BedGridColors.Red == Color.Transparent))
{
this.BedGridColors = new GridColors()
{
Line = Color.Black,
Red = this.ResolveColor(this.BackgroundColor, new Color(Color.Red, this.IsDarkTheme ? 105 : 170)),
Green = this.ResolveColor(this.BackgroundColor, new Color(Color.Green, this.IsDarkTheme ? 105 : 170)),
Blue = this.ResolveColor(this.BackgroundColor, new Color(Color.Blue, 195))
};
}
}
public Color RowBorder { get; set; }
public DropListStyle DropList { get; set; } = new DropListStyle();
@ -213,6 +239,14 @@ namespace MatterHackers.MatterControl
public Color SectionBackgroundColor { get; set; }
public Color PopupBorderColor { get; set; }
public Color BedColor { get; set; }
public Color UnderBedColor { get; set; }
public Color BedLabelColor { get; set; }
public GridColors BedGridColors { get; set; }
public GuiWidget CreateSearchButton()
{
return new IconButton(AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, this.InvertIcons), this)
@ -533,4 +567,12 @@ namespace MatterHackers.MatterControl
public Color QualityPreset { get; set; } = Color.Yellow;
public Color UserOverride { get; set; } = new Color(68, 95, 220, 150);
}
public class GridColors
{
public Color Red { get; set; }
public Color Green { get; set; }
public Color Blue { get; set; }
public Color Line { get; set; }
}
}