Browse Source

Fix #2520: The matched pairs are hardly visible in the dark theme

pull/2529/head
Siegfried Pammer 4 years ago
parent
commit
c5ed7c1ac8
  1. 9
      ILSpy/TextView/BracketHighlightRenderer.cs
  2. 3
      ILSpy/Themes/DarkTheme.xaml
  3. 6
      ILSpy/Themes/LightTheme.xaml
  4. 2
      ILSpy/Themes/ResourceKeys.cs

9
ILSpy/TextView/BracketHighlightRenderer.cs

@ -81,6 +81,8 @@ namespace ICSharpCode.ILSpy.TextView @@ -81,6 +81,8 @@ namespace ICSharpCode.ILSpy.TextView
if (this.result != result)
{
this.result = result;
this.borderPen = (Pen)textView.FindResource(Themes.ResourceKeys.BracketHighlightBorderPen);
this.backgroundBrush = (SolidColorBrush)textView.FindResource(Themes.ResourceKeys.BracketHighlightBackgroundBrush);
textView.InvalidateLayer(this.Layer);
}
}
@ -90,11 +92,8 @@ namespace ICSharpCode.ILSpy.TextView @@ -90,11 +92,8 @@ namespace ICSharpCode.ILSpy.TextView
if (textView == null)
throw new ArgumentNullException("textView");
this.borderPen = new Pen(new SolidColorBrush(Color.FromArgb(52, 0, 0, 255)), 1);
this.borderPen.Freeze();
this.backgroundBrush = new SolidColorBrush(Color.FromArgb(22, 0, 0, 255));
this.backgroundBrush.Freeze();
this.borderPen = (Pen)textView.FindResource(Themes.ResourceKeys.BracketHighlightBorderPen);
this.backgroundBrush = (SolidColorBrush)textView.FindResource(Themes.ResourceKeys.BracketHighlightBackgroundBrush);
this.textView = textView;

3
ILSpy/Themes/DarkTheme.xaml

@ -29,6 +29,9 @@ @@ -29,6 +29,9 @@
<Color x:Key="{x:Static SystemColors.InactiveBorderColorKey}">#434346</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionTextColorKey}">#808080</Color>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#443399FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#883399FF" Thickness="1" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightLightBrushKey}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightBrushKey}" Color="#464646" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#252526" />

6
ILSpy/Themes/LightTheme.xaml

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styles="urn:TomsToolbox.Wpf.Styles">
xmlns:styles="urn:TomsToolbox.Wpf.Styles"
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AvalonDock.Themes.VS2013;component/lighttheme.xaml" />
</ResourceDictionary.MergedDictionaries>
@ -26,6 +27,9 @@ @@ -26,6 +27,9 @@
<Color x:Key="{x:Static SystemColors.InactiveBorderColorKey}">#CCCEDB</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionTextColorKey}">#808080</Color>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#160000FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#340000FF" Thickness="1" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightLightBrushKey}" Color="#FCFCFC" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightBrushKey}" Color="#D8D8E0" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#F5F5F5" />

2
ILSpy/Themes/ResourceKeys.cs

@ -7,5 +7,7 @@ namespace ICSharpCode.ILSpy.Themes @@ -7,5 +7,7 @@ namespace ICSharpCode.ILSpy.Themes
public static ResourceKey TextMarkerBackgroundColor = new ComponentResourceKey(typeof(ResourceKeys), "TextMarkerBackgroundColor");
public static ResourceKey TextMarkerDefinitionBackgroundColor = new ComponentResourceKey(typeof(ResourceKeys), "TextMarkerDefinitionBackgroundColor");
public static ResourceKey LinkTextForegroundBrush = new ComponentResourceKey(typeof(ResourceKeys), "LinkTextForegroundBrush");
public static ResourceKey BracketHighlightBackgroundBrush = new ComponentResourceKey(typeof(ResourceKeys), "BracketHighlightBackgroundBrush");
public static ResourceKey BracketHighlightBorderPen = new ComponentResourceKey(typeof(ResourceKeys), "BracketHighlightBorderPen");
}
}

Loading…
Cancel
Save