From 46605e282e5df5ec660016e7c226ea24f4aada12 Mon Sep 17 00:00:00 2001
From: JFronny <33260128+JFronny@users.noreply.github.com>
Date: Fri, 12 Jun 2020 14:38:07 +0200
Subject: [PATCH] Make "Color" property on TUI screen accessible
---
Commandline/TUI/Screen.cs | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Commandline/TUI/Screen.cs b/Commandline/TUI/Screen.cs
index 79b2b8e..69ce44a 100644
--- a/Commandline/TUI/Screen.cs
+++ b/Commandline/TUI/Screen.cs
@@ -30,10 +30,23 @@ namespace CC_Functions.Commandline.TUI
/// Args
public delegate void OnWindowResize(Screen screen, EventArgs e);
+ private bool _color;
+
///
/// Whether to output in color. Recommended for most terminals, might cause slowdowns in others
///
- public readonly bool Color;
+ public bool Color
+ {
+ get => _color;
+ set
+ {
+ if (_color != value)
+ {
+ _color = value;
+ DiffDraw.Draw(_color);
+ }
+ }
+ }
private int _wndHeight = Console.WindowHeight;
private int _wndWidth = Console.WindowWidth;