Skip to content

Commit

Permalink
imp - Selection and TUI should respect current colors
Browse files Browse the repository at this point in the history
---

The selection style input and the interactive TUI should respect the current colors.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 20, 2024
1 parent 2ac3416 commit 8c1704d
Showing 1 changed file with 134 additions and 22 deletions.
156 changes: 134 additions & 22 deletions public/Nitrocid/Kernel/Configuration/Instances/KernelMainConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
using Nitrocid.ConsoleBase.Writers.MiscWriters;
using Nitrocid.Network.Types.RPC;
using Nitrocid.Network;
using Terminaux.Inputs.Styles.Selection;
using Terminaux.Inputs.Interactive;

namespace Nitrocid.Kernel.Configuration.Instances
{
Expand Down Expand Up @@ -317,7 +319,12 @@ public string UncontinuableKernelErrorColor
public string TextColor
{
get => KernelColorTools.GetColor(KernelColorType.NeutralText).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.NeutralText, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.NeutralText, color);
SelectionStyleSettings.GlobalSettings.TextColor = color;
}
}
/// <summary>
/// License Color
Expand All @@ -341,7 +348,12 @@ public string BackgroundColor
public string InputColor
{
get => KernelColorTools.GetColor(KernelColorType.Input).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.Input, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.Input, color);
SelectionStyleSettings.GlobalSettings.InputColor = color;
}
}
/// <summary>
/// List Entry Color
Expand Down Expand Up @@ -389,7 +401,12 @@ public string WarningTextColor
public string OptionColor
{
get => KernelColorTools.GetColor(KernelColorType.Option).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.Option, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.Option, color);
SelectionStyleSettings.GlobalSettings.OptionColor = color;
}
}
/// <summary>
/// Banner Color
Expand Down Expand Up @@ -437,7 +454,12 @@ public string NotificationFailureColor
public string QuestionColor
{
get => KernelColorTools.GetColor(KernelColorType.Question).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.Question, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.Question, color);
SelectionStyleSettings.GlobalSettings.QuestionColor = color;
}
}
/// <summary>
/// Success Color
Expand Down Expand Up @@ -477,7 +499,12 @@ public string SeparatorTextColor
public string SeparatorColor
{
get => KernelColorTools.GetColor(KernelColorType.Separator).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.Separator, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.Separator, color);
SelectionStyleSettings.GlobalSettings.SeparatorColor = color;
}
}
/// <summary>
/// List Title Color
Expand Down Expand Up @@ -573,15 +600,25 @@ public string TableValueColor
public string SelectedOptionColor
{
get => KernelColorTools.GetColor(KernelColorType.SelectedOption).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.SelectedOption, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.SelectedOption, color);
SelectionStyleSettings.GlobalSettings.SelectedOptionColor = color;
}
}
/// <summary>
/// Alternative Option Color
/// </summary>
public string AlternativeOptionColor
{
get => KernelColorTools.GetColor(KernelColorType.AlternativeOption).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.AlternativeOption, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.AlternativeOption, color);
SelectionStyleSettings.GlobalSettings.AltOptionColor = color;
}
}
/// <summary>
/// Weekend Day Color
Expand Down Expand Up @@ -621,119 +658,194 @@ public string TodayDayColor
public string TuiBackgroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiBackground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiBackground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiBackground, color);
InteractiveTuiStatus.BackgroundColor = color;
}
}
/// <summary>
/// Interactive TUI foreground color
/// </summary>
public string TuiForegroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiForeground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiForeground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiBoxForeground, color);
InteractiveTuiStatus.ForegroundColor = color;
}
}
/// <summary>
/// Interactive TUI pane background color
/// </summary>
public string TuiPaneBackgroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneBackground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneBackground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneBackground, color);
InteractiveTuiStatus.PaneBackgroundColor = color;
}
}
/// <summary>
/// Interactive TUI pane separator color
/// </summary>
public string TuiPaneSeparatorColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneSeparator).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneSeparator, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneSeparator, color);
InteractiveTuiStatus.PaneSeparatorColor = color;
}
}
/// <summary>
/// Interactive TUI selected pane separator color
/// </summary>
public string TuiPaneSelectedSeparatorColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneSelectedSeparator).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedSeparator, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedSeparator, color);
InteractiveTuiStatus.PaneSelectedSeparatorColor = color;
}
}
/// <summary>
/// Interactive TUI selected pane item foreground color
/// </summary>
public string TuiPaneSelectedItemForeColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneSelectedItemFore).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedItemFore, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedItemFore, color);
InteractiveTuiStatus.PaneSelectedItemForeColor = color;
}
}
/// <summary>
/// Interactive TUI selected pane item background color
/// </summary>
public string TuiPaneSelectedItemBackColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneSelectedItemBack).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedItemBack, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneSelectedItemBack, color);
InteractiveTuiStatus.PaneSelectedItemBackColor = color;
}
}
/// <summary>
/// Interactive TUI pane item foreground color
/// </summary>
public string TuiPaneItemForeColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneItemFore).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneItemFore, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneItemFore, color);
InteractiveTuiStatus.PaneItemForeColor = color;
}
}
/// <summary>
/// Interactive TUI pane item background color
/// </summary>
public string TuiPaneItemBackColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiPaneItemBack).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiPaneItemBack, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiPaneItemBack, color);
InteractiveTuiStatus.PaneItemBackColor = color;
}
}
/// <summary>
/// Interactive TUI option background color
/// </summary>
public string TuiOptionBackgroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiOptionBackground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiOptionBackground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiOptionBackground, color);
InteractiveTuiStatus.OptionBackgroundColor = color;
}
}
/// <summary>
/// Interactive TUI option foreground color
/// </summary>
public string TuiOptionForegroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiOptionForeground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiOptionForeground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiOptionForeground, color);
InteractiveTuiStatus.OptionForegroundColor = color;
}
}
/// <summary>
/// Interactive TUI option binding name color
/// </summary>
public string TuiKeyBindingOptionColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiKeyBindingOption).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiKeyBindingOption, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiKeyBindingOption, color);
InteractiveTuiStatus.KeyBindingOptionColor = color;
}
}
/// <summary>
/// Interactive TUI box background color
/// </summary>
public string TuiBoxBackgroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiBoxBackground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiBoxBackground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiBoxBackground, color);
InteractiveTuiStatus.BoxBackgroundColor = color;
}
}
/// <summary>
/// Interactive TUI box foreground color
/// </summary>
public string TuiBoxForegroundColor
{
get => KernelColorTools.GetColor(KernelColorType.TuiBoxForeground).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.TuiBoxForeground, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.TuiBoxForeground, color);
InteractiveTuiStatus.BoxForegroundColor = color;
}
}
/// <summary>
/// Disabled option color
/// </summary>
public string DisabledOptionColor
{
get => KernelColorTools.GetColor(KernelColorType.DisabledOption).PlainSequence;
set => KernelColorTools.SetColor(KernelColorType.DisabledOption, new Color(value));
set
{
var color = new Color(value);
KernelColorTools.SetColor(KernelColorType.DisabledOption, color);
SelectionStyleSettings.GlobalSettings.DisabledOptionColor = color;
}
}
#endregion

Expand Down

0 comments on commit 8c1704d

Please sign in to comment.