@@ -183,11 +183,11 @@ protected override Size MeasureOverride(Size availableSize)
183183
184184 if ( DataContext is ViewModels . BranchTreeNode { Backend : Models . Branch branch } )
185185 {
186- var status = branch . TrackStatus . ToString ( ) ;
187- if ( ! string . IsNullOrEmpty ( status ) )
186+ var desc = branch . TrackStatusDescription ;
187+ if ( ! string . IsNullOrEmpty ( desc ) )
188188 {
189189 _label = new FormattedText (
190- status ,
190+ desc ,
191191 CultureInfo . CurrentCulture ,
192192 FlowDirection . LeftToRight ,
193193 new Typeface ( FontFamily ) ,
@@ -212,22 +212,18 @@ protected override void OnDataContextChanged(EventArgs e)
212212
213213 Text = string . Empty ;
214214
215- if ( DataContext is not Models . Branch { TrackStatus : { IsVisible : true } track } )
215+ if ( DataContext is not Models . Branch { IsTrackStatusVisible : true } branch )
216216 {
217217 SetCurrentValue ( IsVisibleProperty , false ) ;
218218 return ;
219219 }
220220
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 ) ;
231227
232228 SetCurrentValue ( IsVisibleProperty , true ) ;
233229 }
@@ -638,7 +634,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
638634 var fastForward = new MenuItem ( ) ;
639635 fastForward . Header = App . Text ( "BranchCM.FastForward" , upstream . FriendlyName ) ;
640636 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 ;
642638 fastForward . Click += async ( _ , e ) =>
643639 {
644640 if ( repo . CanCreatePopup ( ) )
@@ -685,7 +681,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
685681 var fastForward = new MenuItem ( ) ;
686682 fastForward . Header = App . Text ( "BranchCM.FastForward" , upstream . FriendlyName ) ;
687683 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 ;
689685 fastForward . Click += async ( _ , e ) =>
690686 {
691687 if ( repo . CanCreatePopup ( ) )
@@ -697,7 +693,7 @@ private ContextMenu CreateContextMenuForLocalBranch(ViewModels.Repository repo,
697693 var fetchInto = new MenuItem ( ) ;
698694 fetchInto . Header = App . Text ( "BranchCM.FetchInto" , upstream . FriendlyName , branch . Name ) ;
699695 fetchInto . Icon = App . CreateMenuIcon ( "Icons.Fetch" ) ;
700- fetchInto . IsEnabled = branch . TrackStatus . Ahead . Count == 0 ;
696+ fetchInto . IsEnabled = branch . Ahead . Count == 0 ;
701697 fetchInto . Click += async ( _ , e ) =>
702698 {
703699 if ( repo . CanCreatePopup ( ) )
0 commit comments