From c7b60f3564a850ad6dfae1f51f91a6b707847557 Mon Sep 17 00:00:00 2001 From: Ceiridge Date: Sun, 4 Apr 2021 03:39:49 +0200 Subject: [PATCH] Enhancement: Better console contrast --- ChromeDevExtWarningPatcher/MainView.xaml.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ChromeDevExtWarningPatcher/MainView.xaml.cs b/ChromeDevExtWarningPatcher/MainView.xaml.cs index 516eca4..32fe3a6 100644 --- a/ChromeDevExtWarningPatcher/MainView.xaml.cs +++ b/ChromeDevExtWarningPatcher/MainView.xaml.cs @@ -14,23 +14,24 @@ using System.Windows.Media.Imaging; using Brush = System.Windows.Media.Brush; using Brushes = System.Windows.Media.Brushes; +using Color = System.Windows.Media.Color; namespace ChromeDevExtWarningPatcher { public partial class MainView : Window { private readonly MainModel mainModel = new MainModel(); private readonly InstallationManager installationManager = new InstallationManager(); + private static readonly Brush GRAY_BRUSH = new SolidColorBrush(Color.FromRgb(148, 148, 148)); public MainView() { this.InitializeComponent(); this.DataContext = this.mainModel; } - public void Log(string str, Brush? color = null) { // Add a line to the ConsoleBox and scroll to end + public void Log(string str, Brush? color) { // Add a line to the ConsoleBox and scroll to end this.ConsoleBox.Dispatcher.Invoke(() => { - Paragraph logParagraph = new Paragraph(); - if (color != null) { - logParagraph.Foreground = color; - } + Paragraph logParagraph = new Paragraph { + Foreground = color ?? GRAY_BRUSH + }; logParagraph.Inlines.Add(str); this.ConsoleBox.Document.Blocks.Add(logParagraph);