@@ -64,15 +64,6 @@ public bool UseGraphColor
6464 set => SetValue ( UseGraphColorProperty , value ) ;
6565 }
6666
67- public static readonly StyledProperty < IBrush > TagBackgroundProperty =
68- AvaloniaProperty . Register < CommitRefsPresenter , IBrush > ( nameof ( TagBackground ) , Brushes . White ) ;
69-
70- public IBrush TagBackground
71- {
72- get => GetValue ( TagBackgroundProperty ) ;
73- set => SetValue ( TagBackgroundProperty , value ) ;
74- }
75-
7667 public static readonly StyledProperty < bool > AllowWrapProperty =
7768 AvaloniaProperty . Register < CommitRefsPresenter , bool > ( nameof ( AllowWrap ) ) ;
7869
@@ -82,15 +73,24 @@ public bool AllowWrap
8273 set => SetValue ( AllowWrapProperty , value ) ;
8374 }
8475
76+ public static readonly StyledProperty < bool > ShowTagsProperty =
77+ AvaloniaProperty . Register < CommitRefsPresenter , bool > ( nameof ( ShowTags ) , true ) ;
78+
79+ public bool ShowTags
80+ {
81+ get => GetValue ( ShowTagsProperty ) ;
82+ set => SetValue ( ShowTagsProperty , value ) ;
83+ }
84+
8585 static CommitRefsPresenter ( )
8686 {
8787 AffectsMeasure < CommitRefsPresenter > (
8888 FontFamilyProperty ,
8989 FontSizeProperty ,
9090 ForegroundProperty ,
9191 UseGraphColorProperty ,
92- TagBackgroundProperty ,
93- BackgroundProperty ) ;
92+ BackgroundProperty ,
93+ ShowTagsProperty ) ;
9494 }
9595
9696 public override void Render ( DrawingContext context )
@@ -171,15 +171,18 @@ protected override Size MeasureOverride(Size availableSize)
171171 var typefaceBold = new Typeface ( FontFamily , FontStyle . Normal , FontWeight . Bold ) ;
172172 var fg = Foreground ;
173173 var normalBG = UseGraphColor ? commit . Brush : Brushes . Gray ;
174- var tagBG = UseGraphColor ? TagBackground : Brushes . Gray ;
175174 var labelSize = FontSize ;
176175 var requiredWidth = 0.0 ;
177176 var requiredHeight = 16.0 ;
178177 var x = 0.0 ;
179178 var allowWrap = AllowWrap ;
179+ var showTags = ShowTags ;
180180
181181 foreach ( var decorator in refs )
182182 {
183+ if ( ! showTags && decorator . Type == Models . DecoratorType . Tag )
184+ continue ;
185+
183186 var isHead = decorator . Type == Models . DecoratorType . CurrentBranchHead ||
184187 decorator . Type == Models . DecoratorType . CurrentCommitHead ;
185188
@@ -209,7 +212,7 @@ protected override Size MeasureOverride(Size availableSize)
209212 geo = this . FindResource ( "Icons.Remote" ) as StreamGeometry ;
210213 break ;
211214 case Models . DecoratorType . Tag :
212- item . Brush = tagBG ;
215+ item . Brush = Brushes . Gray ;
213216 geo = this . FindResource ( "Icons.Tag" ) as StreamGeometry ;
214217 break ;
215218 default :
0 commit comments