@@ -64,15 +64,6 @@ public bool UseGraphColor
64
64
set => SetValue ( UseGraphColorProperty , value ) ;
65
65
}
66
66
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
-
76
67
public static readonly StyledProperty < bool > AllowWrapProperty =
77
68
AvaloniaProperty . Register < CommitRefsPresenter , bool > ( nameof ( AllowWrap ) ) ;
78
69
@@ -82,15 +73,24 @@ public bool AllowWrap
82
73
set => SetValue ( AllowWrapProperty , value ) ;
83
74
}
84
75
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
+
85
85
static CommitRefsPresenter ( )
86
86
{
87
87
AffectsMeasure < CommitRefsPresenter > (
88
88
FontFamilyProperty ,
89
89
FontSizeProperty ,
90
90
ForegroundProperty ,
91
91
UseGraphColorProperty ,
92
- TagBackgroundProperty ,
93
- BackgroundProperty ) ;
92
+ BackgroundProperty ,
93
+ ShowTagsProperty ) ;
94
94
}
95
95
96
96
public override void Render ( DrawingContext context )
@@ -171,15 +171,18 @@ protected override Size MeasureOverride(Size availableSize)
171
171
var typefaceBold = new Typeface ( FontFamily , FontStyle . Normal , FontWeight . Bold ) ;
172
172
var fg = Foreground ;
173
173
var normalBG = UseGraphColor ? commit . Brush : Brushes . Gray ;
174
- var tagBG = UseGraphColor ? TagBackground : Brushes . Gray ;
175
174
var labelSize = FontSize ;
176
175
var requiredWidth = 0.0 ;
177
176
var requiredHeight = 16.0 ;
178
177
var x = 0.0 ;
179
178
var allowWrap = AllowWrap ;
179
+ var showTags = ShowTags ;
180
180
181
181
foreach ( var decorator in refs )
182
182
{
183
+ if ( ! showTags && decorator . Type == Models . DecoratorType . Tag )
184
+ continue ;
185
+
183
186
var isHead = decorator . Type == Models . DecoratorType . CurrentBranchHead ||
184
187
decorator . Type == Models . DecoratorType . CurrentCommitHead ;
185
188
@@ -209,7 +212,7 @@ protected override Size MeasureOverride(Size availableSize)
209
212
geo = this . FindResource ( "Icons.Remote" ) as StreamGeometry ;
210
213
break ;
211
214
case Models . DecoratorType . Tag :
212
- item . Brush = tagBG ;
215
+ item . Brush = Brushes . Gray ;
213
216
geo = this . FindResource ( "Icons.Tag" ) as StreamGeometry ;
214
217
break ;
215
218
default :
0 commit comments