@@ -183,11 +183,11 @@ protected override Size MeasureOverride(Size availableSize)
183
183
184
184
if ( DataContext is ViewModels . BranchTreeNode { Backend : Models . Branch branch } )
185
185
{
186
- var status = branch . TrackStatus . ToString ( ) ;
187
- if ( ! string . IsNullOrEmpty ( status ) )
186
+ var desc = branch . TrackStatusDescription ;
187
+ if ( ! string . IsNullOrEmpty ( desc ) )
188
188
{
189
189
_label = new FormattedText (
190
- status ,
190
+ desc ,
191
191
CultureInfo . CurrentCulture ,
192
192
FlowDirection . LeftToRight ,
193
193
new Typeface ( FontFamily ) ,
@@ -212,22 +212,18 @@ protected override void OnDataContextChanged(EventArgs e)
212
212
213
213
Text = string . Empty ;
214
214
215
- if ( DataContext is not Models . Branch { TrackStatus : { IsVisible : true } track } )
215
+ if ( DataContext is not Models . Branch { IsTrackStatusVisible : true } branch )
216
216
{
217
217
SetCurrentValue ( IsVisibleProperty , false ) ;
218
218
return ;
219
219
}
220
220
221
- if ( track . Ahead . Count > 0 )
222
- {
223
- Text = track . Behind . Count > 0 ?
224
- App . Text ( "BranchTree.AheadBehind" , track . Ahead . Count , track . Behind . Count ) :
225
- App . Text ( "BranchTree.Ahead" , track . Ahead . Count ) ;
226
- }
227
- else if ( track . Behind . Count > 0 )
228
- {
229
- Text = App . Text ( "BranchTree.Behind" , track . Behind . Count ) ;
230
- }
221
+ var ahead = branch . Ahead . Count ;
222
+ var behind = branch . Behind . Count ;
223
+ if ( ahead > 0 )
224
+ Text = behind > 0 ? App . Text ( "BranchTree.AheadBehind" , ahead , behind ) : App . Text ( "BranchTree.Ahead" , ahead ) ;
225
+ else
226
+ Text = App . Text ( "BranchTree.Behind" , behind ) ;
231
227
232
228
SetCurrentValue ( IsVisibleProperty , true ) ;
233
229
}
@@ -638,7 +634,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
638
634
var fastForward = new MenuItem ( ) ;
639
635
fastForward . Header = App . Text ( "BranchCM.FastForward" , upstream . FriendlyName ) ;
640
636
fastForward . Icon = App . CreateMenuIcon ( "Icons.FastForward" ) ;
641
- fastForward . IsEnabled = branch . TrackStatus . Ahead . Count == 0 && branch . TrackStatus . Behind . Count > 0 ;
637
+ fastForward . IsEnabled = branch . Ahead . Count == 0 && branch . Behind . Count > 0 ;
642
638
fastForward . Click += async ( _ , e ) =>
643
639
{
644
640
if ( repo . CanCreatePopup ( ) )
@@ -685,7 +681,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
685
681
var fastForward = new MenuItem ( ) ;
686
682
fastForward . Header = App . Text ( "BranchCM.FastForward" , upstream . FriendlyName ) ;
687
683
fastForward . Icon = App . CreateMenuIcon ( "Icons.FastForward" ) ;
688
- fastForward . IsEnabled = branch . TrackStatus . Ahead . Count == 0 && branch . TrackStatus . Behind . Count > 0 ;
684
+ fastForward . IsEnabled = branch . Ahead . Count == 0 && branch . Behind . Count > 0 ;
689
685
fastForward . Click += async ( _ , e ) =>
690
686
{
691
687
if ( repo . CanCreatePopup ( ) )
@@ -697,7 +693,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
697
693
var fetchInto = new MenuItem ( ) ;
698
694
fetchInto . Header = App . Text ( "BranchCM.FetchInto" , upstream . FriendlyName , branch . Name ) ;
699
695
fetchInto . Icon = App . CreateMenuIcon ( "Icons.Fetch" ) ;
700
- fetchInto . IsEnabled = branch . TrackStatus . Ahead . Count == 0 ;
696
+ fetchInto . IsEnabled = branch . Ahead . Count == 0 ;
701
697
fetchInto . Click += async ( _ , e ) =>
702
698
{
703
699
if ( repo . CanCreatePopup ( ) )
0 commit comments