@@ -47,6 +47,15 @@ public FontWeight FontWeight
4747 get => GetValue ( FontWeightProperty ) ;
4848 set => SetValue ( FontWeightProperty , value ) ;
4949 }
50+
51+ public static readonly StyledProperty < IBrush > InlineCodeBackgroundProperty =
52+ AvaloniaProperty . Register < CommitSubjectPresenter , IBrush > ( nameof ( InlineCodeBackground ) , Brushes . Transparent ) ;
53+
54+ public IBrush InlineCodeBackground
55+ {
56+ get => GetValue ( InlineCodeBackgroundProperty ) ;
57+ set => SetValue ( InlineCodeBackgroundProperty , value ) ;
58+ }
5059
5160 public static readonly StyledProperty < IBrush > ForegroundProperty =
5261 AvaloniaProperty . Register < CommitSubjectPresenter , IBrush > ( nameof ( Foreground ) , Brushes . White ) ;
@@ -106,7 +115,7 @@ public override void Render(DrawingContext context)
106115 {
107116 var rect = new Rect ( inline . X , ( height - inline . Text . Height - 2 ) * 0.5 , inline . Text . WidthIncludingTrailingWhitespace + 8 , inline . Text . Height + 2 ) ;
108117 var roundedRect = new RoundedRect ( rect , new CornerRadius ( 4 ) ) ;
109- context . DrawRectangle ( new SolidColorBrush ( new Color ( 52 , 101 , 108 , 118 ) ) , null , roundedRect ) ;
118+ context . DrawRectangle ( InlineCodeBackground , null , roundedRect ) ;
110119 context . DrawText ( inline . Text , new Point ( inline . X + 4 , ( height - inline . Text . Height ) * 0.5 ) ) ;
111120 }
112121 else
@@ -182,6 +191,10 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
182191 _needRebuildInlines = true ;
183192 InvalidateVisual ( ) ;
184193 }
194+ else if ( change . Property == InlineCodeBackgroundProperty )
195+ {
196+ InvalidateVisual ( ) ;
197+ }
185198 }
186199
187200 protected override void OnPointerMoved ( PointerEventArgs e )
0 commit comments