Skip to content

Commit

Permalink
Enhancement: Better console contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceiridge committed Apr 4, 2021
1 parent 86cffed commit c7b60f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ChromeDevExtWarningPatcher/MainView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c7b60f3

Please sign in to comment.