mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Add full constructor to ColorScheme
This commit is contained in:
@@ -48,6 +48,21 @@ public record ColorScheme : IEqualityOperators<ColorScheme, ColorScheme, bool>
|
||||
_hotFocus = attribute;
|
||||
}
|
||||
|
||||
/// <summary>Creates a new instance, initialized with the values provided.</summary>
|
||||
public ColorScheme (
|
||||
Attribute normal,
|
||||
Attribute focus,
|
||||
Attribute hotNormal,
|
||||
Attribute disabled,
|
||||
Attribute hotFocus)
|
||||
{
|
||||
_normal = normal;
|
||||
_focus = focus;
|
||||
_hotNormal = hotNormal;
|
||||
_disabled = disabled;
|
||||
_hotFocus = hotFocus;
|
||||
}
|
||||
|
||||
/// <summary>The default foreground and background color for text when the view is disabled.</summary>
|
||||
public Attribute Disabled
|
||||
{
|
||||
|
||||
@@ -38,4 +38,27 @@ public class ColorSchemeTests
|
||||
lbl.ColorScheme = scheme;
|
||||
lbl.Draw ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ColorScheme_BigConstructor ()
|
||||
{
|
||||
var a = new Attribute (1);
|
||||
var b = new Attribute (2);
|
||||
var c = new Attribute (3);
|
||||
var d = new Attribute (4);
|
||||
var e = new Attribute (5);
|
||||
|
||||
var cs = new ColorScheme (
|
||||
normal: a,
|
||||
focus: b,
|
||||
hotNormal: c,
|
||||
disabled: d,
|
||||
hotFocus: e);
|
||||
|
||||
Assert.Equal (a, cs.Normal);
|
||||
Assert.Equal (b, cs.Focus);
|
||||
Assert.Equal (c, cs.HotNormal);
|
||||
Assert.Equal (d, cs.Disabled);
|
||||
Assert.Equal (e, cs.HotFocus);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user