@@ -216,8 +216,7 @@ public void Draw(TextView textView, DrawingContext drawingContext)
216216 return ;
217217
218218 var changeBlock = _presenter . BlockNavigation . GetCurrentBlock ( ) ;
219- var changeBlockBG = new SolidColorBrush ( Colors . Gray , 0.25 ) ;
220- var changeBlockFG = new Pen ( Brushes . Gray ) ;
219+ var changeBlockBorder = new Pen ( _presenter . BlockBorderHighlightBrush ) ;
221220
222221 var lines = _presenter . GetLines ( ) ;
223222 var width = textView . Bounds . Width ;
@@ -279,14 +278,14 @@ public void Draw(TextView textView, DrawingContext drawingContext)
279278 }
280279 }
281280
282- if ( changeBlock != null && changeBlock . Contains ( index ) )
283- {
284- drawingContext . DrawRectangle ( changeBlockBG , null , new Rect ( 0 , startY , width , endY - startY ) ) ;
285- if ( index == changeBlock . Start )
286- drawingContext . DrawLine ( changeBlockFG , new Point ( 0 , startY ) , new Point ( width , startY ) ) ;
287- if ( index == changeBlock . End )
288- drawingContext . DrawLine ( changeBlockFG , new Point ( 0 , endY ) , new Point ( width , endY ) ) ;
289- }
281+ if ( changeBlock == null )
282+ continue ;
283+
284+ if ( index == changeBlock . Start )
285+ drawingContext . DrawLine ( changeBlockBorder , new Point ( 0 , startY ) , new Point ( width , startY ) ) ;
286+
287+ if ( index == changeBlock . End )
288+ drawingContext . DrawLine ( changeBlockBorder , new Point ( 0 , endY ) , new Point ( width , endY ) ) ;
290289 }
291290 }
292291
@@ -406,6 +405,15 @@ public IBrush IndicatorForeground
406405 set => SetValue ( IndicatorForegroundProperty , value ) ;
407406 }
408407
408+ public static readonly StyledProperty < IBrush > BlockBorderHighlightBrushProperty =
409+ AvaloniaProperty . Register < ThemedTextDiffPresenter , IBrush > ( nameof ( BlockBorderHighlightBrush ) , Brushes . Gray ) ;
410+
411+ public IBrush BlockBorderHighlightBrush
412+ {
413+ get => GetValue ( BlockBorderHighlightBrushProperty ) ;
414+ set => SetValue ( BlockBorderHighlightBrushProperty , value ) ;
415+ }
416+
409417 public static readonly StyledProperty < bool > UseSyntaxHighlightingProperty =
410418 AvaloniaProperty . Register < ThemedTextDiffPresenter , bool > ( nameof ( UseSyntaxHighlighting ) ) ;
411419
0 commit comments