diff --git a/src/Resources/Themes.axaml b/src/Resources/Themes.axaml index ff4c0374..f33e71d2 100644 --- a/src/Resources/Themes.axaml +++ b/src/Resources/Themes.axaml @@ -25,6 +25,7 @@ #A7E1A7 #F19B9D #0000EE + #FFE5E5E5 @@ -51,6 +52,7 @@ #A0308D3C #A09F4247 #4DAAFC + #FF2E2E2E @@ -79,6 +81,7 @@ + fonts:Inter#Inter fonts:SourceGit#JetBrains Mono diff --git a/src/Views/CommitSubjectPresenter.cs b/src/Views/CommitSubjectPresenter.cs index d00d3951..abb08a3b 100644 --- a/src/Views/CommitSubjectPresenter.cs +++ b/src/Views/CommitSubjectPresenter.cs @@ -47,6 +47,15 @@ namespace SourceGit.Views get => GetValue(FontWeightProperty); set => SetValue(FontWeightProperty, value); } + + public static readonly StyledProperty InlineCodeBackgroundProperty = + AvaloniaProperty.Register(nameof(InlineCodeBackground), Brushes.Transparent); + + public IBrush InlineCodeBackground + { + get => GetValue(InlineCodeBackgroundProperty); + set => SetValue(InlineCodeBackgroundProperty, value); + } public static readonly StyledProperty ForegroundProperty = AvaloniaProperty.Register(nameof(Foreground), Brushes.White); @@ -106,7 +115,7 @@ namespace SourceGit.Views { var rect = new Rect(inline.X, (height - inline.Text.Height - 2) * 0.5, inline.Text.WidthIncludingTrailingWhitespace + 8, inline.Text.Height + 2); var roundedRect = new RoundedRect(rect, new CornerRadius(4)); - context.DrawRectangle(new SolidColorBrush(new Color(52, 101, 108, 118)), null, roundedRect); + context.DrawRectangle(InlineCodeBackground, null, roundedRect); context.DrawText(inline.Text, new Point(inline.X + 4, (height - inline.Text.Height) * 0.5)); } else @@ -182,6 +191,10 @@ namespace SourceGit.Views _needRebuildInlines = true; InvalidateVisual(); } + else if (change.Property == InlineCodeBackgroundProperty) + { + InvalidateVisual(); + } } protected override void OnPointerMoved(PointerEventArgs e) diff --git a/src/Views/Histories.axaml b/src/Views/Histories.axaml index e58d8349..568854fd 100644 --- a/src/Views/Histories.axaml +++ b/src/Views/Histories.axaml @@ -158,6 +158,7 @@