@@ -434,6 +434,21 @@ public bool IsWorktreeGroupExpanded
434434 }
435435 }
436436
437+ public bool IsSortingLocalBranchByName
438+ {
439+ get => _settings . LocalBranchSortMode == Models . BranchSortMode . Name ;
440+ }
441+
442+ public bool IsSortingRemoteBranchByName
443+ {
444+ get => _settings . RemoteBranchSortMode == Models . BranchSortMode . Name ;
445+ }
446+
447+ public bool IsSortingTagsByName
448+ {
449+ get => _settings . TagSortMode == Models . TagSortMode . Name ;
450+ }
451+
437452 public InProgressContext InProgressContext
438453 {
439454 get => _workingCopy ? . InProgressContext ;
@@ -2381,9 +2396,15 @@ public ContextMenu CreateContextMenuForBranchSortMode(bool local)
23812396 var changeMode = new Action < Models . BranchSortMode > ( m =>
23822397 {
23832398 if ( local )
2399+ {
23842400 _settings . LocalBranchSortMode = m ;
2401+ OnPropertyChanged ( nameof ( IsSortingLocalBranchByName ) ) ;
2402+ }
23852403 else
2404+ {
23862405 _settings . RemoteBranchSortMode = m ;
2406+ OnPropertyChanged ( nameof ( IsSortingRemoteBranchByName ) ) ;
2407+ }
23872408
23882409 var builder = BuildBranchTree ( _branches , _remotes ) ;
23892410 LocalBranchTrees = builder . Locals ;
@@ -2415,6 +2436,7 @@ public ContextMenu CreateContextMenuForBranchSortMode(bool local)
24152436 } ;
24162437
24172438 var menu = new ContextMenu ( ) ;
2439+ menu . Placement = PlacementMode . BottomEdgeAlignedLeft ;
24182440 menu . Items . Add ( byNameAsc ) ;
24192441 menu . Items . Add ( byCommitterDate ) ;
24202442 return menu ;
@@ -2428,6 +2450,7 @@ public ContextMenu CreateContextMenuForTagSortMode()
24282450 if ( _settings . TagSortMode != m )
24292451 {
24302452 _settings . TagSortMode = m ;
2453+ OnPropertyChanged ( nameof ( IsSortingTagsByName ) ) ;
24312454 VisibleTags = BuildVisibleTags ( ) ;
24322455 }
24332456 } ) ;
@@ -2453,6 +2476,7 @@ public ContextMenu CreateContextMenuForTagSortMode()
24532476 } ;
24542477
24552478 var menu = new ContextMenu ( ) ;
2479+ menu . Placement = PlacementMode . BottomEdgeAlignedLeft ;
24562480 menu . Items . Add ( byCreatorDate ) ;
24572481 menu . Items . Add ( byName ) ;
24582482 return menu ;
0 commit comments