Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add more theme colors #2952

Merged
merged 4 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ILSpy/TextView/BracketHighlightRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public void Draw(ICSharpCode.AvalonEdit.Rendering.TextView textView, DrawingCont
BackgroundGeometryBuilder builder = new BackgroundGeometryBuilder();

builder.CornerRadius = 1;
builder.AlignToWholePixels = true;
builder.BorderThickness = borderPen?.Thickness ?? 0;

builder.AddSegment(textView, new TextSegment() { StartOffset = result.OpeningBracketOffset, Length = result.OpeningBracketLength });
builder.CloseFigure(); // prevent connecting the two segments
Expand Down
2 changes: 2 additions & 0 deletions ILSpy/TextView/DecompilerTextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public DecompilerTextView()
ContextMenuProvider.Add(this);

textEditor.TextArea.TextView.SetResourceReference(ICSharpCode.AvalonEdit.Rendering.TextView.LinkTextForegroundBrushProperty, ResourceKeys.LinkTextForegroundBrush);
textEditor.TextArea.TextView.SetResourceReference(ICSharpCode.AvalonEdit.Rendering.TextView.CurrentLineBackgroundProperty, ResourceKeys.CurrentLineBackgroundBrush);
textEditor.TextArea.TextView.SetResourceReference(ICSharpCode.AvalonEdit.Rendering.TextView.CurrentLineBorderProperty, ResourceKeys.CurrentLineBorderPen);

this.DataContextChanged += DecompilerTextView_DataContextChanged;
}
Expand Down
1 change: 1 addition & 0 deletions ILSpy/TextView/DecompilerTextView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<ae:TextEditor Name="textEditor" AutomationProperties.Name="Decompilation" FontFamily="Consolas" FontSize="10pt" IsReadOnly="True"
Background="{DynamicResource {x:Static themes:ResourceKeys.TextBackgroundBrush}}"
Foreground="{DynamicResource {x:Static themes:ResourceKeys.TextForegroundBrush}}"
LineNumbersForeground="{DynamicResource {x:Static themes:ResourceKeys.LineNumbersForegroundBrush}}"
folding:FoldingMargin.FoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
folding:FoldingMargin.SelectedFoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
folding:FoldingMargin.FoldingMarkerBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
Expand Down
8 changes: 5 additions & 3 deletions ILSpy/Themes/Base.Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="Black" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="White" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#995A23" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="Gray" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#1614DCE0" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#3400FF6E" Thickness="1" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#443399FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#883399FF" Thickness="1" />

<Color x:Key="{x:Static SystemColors.ControlLightLightColorKey}">#333337</Color>
<Color x:Key="{x:Static SystemColors.ControlLightColorKey}">#464646</Color>
Expand All @@ -33,9 +38,6 @@
<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" />
Expand Down
10 changes: 6 additions & 4 deletions ILSpy/Themes/Base.Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="White" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="Black" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}">LightGreen</SolidColorBrush>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="LightGreen" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="Gray" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#1614DCE0" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#3400FF6E" Thickness="1" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#160000FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#340000FF" Thickness="1" />

<Color x:Key="{x:Static SystemColors.ControlLightLightColorKey}">#FCFCFC</Color>
<Color x:Key="{x:Static SystemColors.ControlLightColorKey}">#D8D8E0</Color>
Expand All @@ -31,9 +36,6 @@
<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" />
Expand Down
3 changes: 3 additions & 0 deletions ILSpy/Themes/ResourceKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public static class ResourceKeys
public static ResourceKey LinkTextForegroundBrush = new ComponentResourceKey(typeof(ResourceKeys), nameof(LinkTextForegroundBrush));
public static ResourceKey BracketHighlightBackgroundBrush = new ComponentResourceKey(typeof(ResourceKeys), nameof(BracketHighlightBackgroundBrush));
public static ResourceKey BracketHighlightBorderPen = new ComponentResourceKey(typeof(ResourceKeys), nameof(BracketHighlightBorderPen));
public static ResourceKey LineNumbersForegroundBrush = new ComponentResourceKey(typeof(ResourceKeys), nameof(LineNumbersForegroundBrush));
public static ResourceKey CurrentLineBackgroundBrush = new ComponentResourceKey(typeof(ResourceKeys), nameof(CurrentLineBackgroundBrush));
public static ResourceKey CurrentLineBorderPen = new ComponentResourceKey(typeof(ResourceKeys), nameof(CurrentLineBorderPen));
public static ResourceKey ThemeAwareButtonEffect = new ComponentResourceKey(typeof(ResourceKeys), nameof(ThemeAwareButtonEffect));
}
}
5 changes: 5 additions & 0 deletions ILSpy/Themes/Theme.Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#995A23" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="Gray" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#1614DCE0" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#3400FF6E" Thickness="1" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#443399FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#883399FF" Thickness="1" />

<!-- ILAsm -->
<themes:SyntaxColor x:Key="SyntaxColor.ILAsm.Comment" Foreground="#FF57A64A" />
Expand Down
5 changes: 5 additions & 0 deletions ILSpy/Themes/Theme.Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="{DynamicResource {x:Static SystemColors.InfoColorKey}}" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="{DynamicResource {x:Static SystemColors.InfoTextColorKey}}" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="LightGreen" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="Gray" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#1614DCE0" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#3400FF6E" Thickness="1" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#160000FF" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#340000FF" Thickness="1" />

<!-- ILAsm -->
<themes:SyntaxColor x:Key="SyntaxColor.ILAsm.Comment" Foreground="Green" />
Expand Down
7 changes: 6 additions & 1 deletion ILSpy/Themes/Theme.RSharpDark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="#DCDCDC" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}">#995A23</SolidColorBrush>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#995A23" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="#2B91AF" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#0F0F0F" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#0E4583" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" />

<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">#483D8B</Color>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerDefinitionBackgroundColor}">#800000</Color>
Expand Down
7 changes: 6 additions & 1 deletion ILSpy/Themes/Theme.RSharpLight.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="White" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="Black" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}">#F6B94D</SolidColorBrush>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#F6B94D"/>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="#85A8AF" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" Color="#F7F7F7" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#C4D5DB" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" />

<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">#87CEFA</Color>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerDefinitionBackgroundColor}">#FFB6C1</Color>
Expand Down
5 changes: 5 additions & 0 deletions ILSpy/Themes/Theme.VSCodeDarkPlus.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="#D4D4D4" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#613214" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="#858585" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#282828" Thickness="2" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#1B251B" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#888888" Thickness="1" />

<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">#264F78</Color>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerDefinitionBackgroundColor}">#343A40</Color>
Expand Down
5 changes: 5 additions & 0 deletions ILSpy/Themes/Theme.VSCodeLightPlus.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextBackgroundBrush}" Color="White" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.TextForegroundBrush}" Color="Black" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.SearchResultBackgroundBrush}" Color="#F8C9AB" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LineNumbersForegroundBrush}" Color="#237893" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.CurrentLineBackgroundBrush}" />
<Pen x:Key="{x:Static themes:ResourceKeys.CurrentLineBorderPen}" Brush="#EEEEEE" Thickness="2" />
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.BracketHighlightBackgroundBrush}" Color="#E5EFE5" />
<Pen x:Key="{x:Static themes:ResourceKeys.BracketHighlightBorderPen}" Brush="#B9B9B9" Thickness="1" />

<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">#ADD6FF</Color>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerDefinitionBackgroundColor}">#D6EAFF</Color>
Expand Down