More simplification

This commit is contained in:
Tigger Kindel
2023-10-10 11:30:01 -06:00
committed by Tig
parent 3ff5453c56
commit 841bbf2ed7
3 changed files with 14 additions and 48 deletions

View File

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

View File

@@ -744,14 +744,6 @@ namespace Terminal.Gui {
[JsonIgnore]
public bool Initialized { get; internal set; }
//// TODO: This no longer makes sense - remove it
///// <summary>
///// Returns <see langword="true"/> if the Attribute is valid (both foreground and background have valid color values).
///// </summary>
///// <returns></returns>
//[JsonIgnore]
//public bool HasValidColors => (int)Foreground.ColorName > -1 && (int)Background.ColorName > -1;
/// <inheritdoc />
public override string ToString ()
{
@@ -761,7 +753,7 @@ namespace Terminal.Gui {
}
/// <summary>
/// Defines the color <see cref="Attribute"/>s for common visible elements in a <see cref="View"/>.
/// Defines the <see cref="Attribute"/>s for common visible elements in a <see cref="View"/>.
/// Containers such as <see cref="Window"/> and <see cref="FrameView"/> use <see cref="ColorScheme"/> to determine
/// the colors used by sub-views.
/// </summary>
@@ -780,7 +772,7 @@ namespace Terminal.Gui {
/// Used by <see cref="Colors.SetColorScheme(ColorScheme, string)"/> and <see cref="Colors.GetColorScheme(string)"/> to track which ColorScheme
/// is being accessed.
/// </summary>
internal string schemeBeingSet = "";
internal string _schemeBeingSet = "";
/// <summary>
/// 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.
/// </summary>
public Attribute Normal {
get { return _normal; }
set {
//if (!value.HasValidColors) {
// return;
//}
_normal = value;
}
get => _normal;
set => _normal = value;
}
/// <summary>
/// The foreground and background color for text when the view has the focus.
/// </summary>
public Attribute Focus {
get { return _focus; }
set {
//if (!value.HasValidColors) {
// return;
//}
_focus = value;
}
get => _focus;
set => _focus = value;
}
/// <summary>
/// The foreground and background color for text when the view is highlighted (hot).
/// </summary>
public Attribute HotNormal {
get { return _hotNormal; }
set {
//if (!value.HasValidColors) {
// return;
//}
_hotNormal = value;
}
get => _hotNormal;
set => _hotNormal = value;
}
/// <summary>
/// The foreground and background color for text when the view is highlighted (hot) and has focus.
/// </summary>
public Attribute HotFocus {
get { return _hotFocus; }
set {
//if (!value.HasValidColors) {
// return;
//}
_hotFocus = value;
}
get => _hotFocus;
set => _hotFocus = value;
}
/// <summary>
/// The default foreground and background color for text, when the view is disabled.
/// </summary>
public Attribute Disabled {
get { return _disabled; }
set {
//if (!value.HasValidColors) {
// return;
//}
_disabled = value;
}
get => _disabled;
set => _disabled = value;
}
/// <summary>
@@ -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;
}
/// <summary>

View File

@@ -113,7 +113,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/AbsolutePath/@EntryValue">Terminal.sln.DotSettings</s:String>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=CAF4ECB3AC41AE43BD233D613AC1562C/RelativePath/@EntryValue"></s:String>