diff --git a/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs b/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs index b2a250fe2..13428beae 100644 --- a/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs +++ b/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs @@ -390,7 +390,6 @@ public abstract class ConsoleDriver { public Attribute CurrentAttribute { get => _currentAttribute; set { - //if (value is { Initialized: false, HasValidColors: true } && Application.Driver != null) { if (value is { Initialized: false } && Application.Driver != null) { _currentAttribute = new Attribute (value.Foreground, value.Background); return; diff --git a/Terminal.Gui/Drawing/Color.cs b/Terminal.Gui/Drawing/Color.cs index 8bdb46ae7..5a2ce95f1 100644 --- a/Terminal.Gui/Drawing/Color.cs +++ b/Terminal.Gui/Drawing/Color.cs @@ -744,14 +744,6 @@ namespace Terminal.Gui { [JsonIgnore] public bool Initialized { get; internal set; } - //// TODO: This no longer makes sense - remove it - ///// - ///// Returns if the Attribute is valid (both foreground and background have valid color values). - ///// - ///// - //[JsonIgnore] - //public bool HasValidColors => (int)Foreground.ColorName > -1 && (int)Background.ColorName > -1; - /// public override string ToString () { @@ -761,7 +753,7 @@ namespace Terminal.Gui { } /// - /// Defines the color s for common visible elements in a . + /// Defines the s for common visible elements in a . /// Containers such as and use to determine /// the colors used by sub-views. /// @@ -780,7 +772,7 @@ namespace Terminal.Gui { /// Used by and to track which ColorScheme /// is being accessed. /// - internal string schemeBeingSet = ""; + internal string _schemeBeingSet = ""; /// /// Creates a new instance. @@ -819,65 +811,40 @@ namespace Terminal.Gui { /// The foreground and background color for text when the view is not focused, hot, or disabled. /// public Attribute Normal { - get { return _normal; } - set { - //if (!value.HasValidColors) { - // return; - //} - _normal = value; - } + get => _normal; + set => _normal = value; } /// /// The foreground and background color for text when the view has the focus. /// public Attribute Focus { - get { return _focus; } - set { - //if (!value.HasValidColors) { - // return; - //} - _focus = value; - } + get => _focus; + set => _focus = value; } /// /// The foreground and background color for text when the view is highlighted (hot). /// public Attribute HotNormal { - get { return _hotNormal; } - set { - //if (!value.HasValidColors) { - // return; - //} - _hotNormal = value; - } + get => _hotNormal; + set => _hotNormal = value; } /// /// The foreground and background color for text when the view is highlighted (hot) and has focus. /// public Attribute HotFocus { - get { return _hotFocus; } - set { - //if (!value.HasValidColors) { - // return; - //} - _hotFocus = value; - } + get => _hotFocus; + set => _hotFocus = value; } /// /// The default foreground and background color for text, when the view is disabled. /// public Attribute Disabled { - get { return _disabled; } - set { - //if (!value.HasValidColors) { - // return; - //} - _disabled = value; - } + get => _disabled; + set => _disabled = value; } /// @@ -1062,7 +1029,7 @@ namespace Terminal.Gui { static void SetColorScheme (ColorScheme colorScheme, [CallerMemberName] string schemeBeingSet = null) { ColorSchemes [schemeBeingSet] = colorScheme; - colorScheme.schemeBeingSet = schemeBeingSet; + colorScheme._schemeBeingSet = schemeBeingSet; } /// diff --git a/Terminal.sln.DotSettings b/Terminal.sln.DotSettings index 388ebb2da..6abc41171 100644 --- a/Terminal.sln.DotSettings +++ b/Terminal.sln.DotSettings @@ -113,7 +113,7 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="_" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> True Terminal.sln.DotSettings