Browse Source

Re-group View menu so Navigation comes before Tree operations

The MEF block of the View menu used MenuOrder = 100/101 for Back/
Forward but no MenuOrder on Sort assembly list / Collapse all tree
nodes, so the latter two implicitly defaulted to 0 and ended up
appearing before Back/Forward despite their numerically larger
explicit order. The intent reads better the other way around:
Back/Forward are high-frequency keyboard-driven actions (Alt+Left/
Right) and belong adjacent to the show-radios block, while Sort and
Collapse are tree-operation bulk actions that belong further down.

Use the same non-overlapping MenuOrder ranges that File now follows:

  Navigation: 0 .. 9      (Back, Forward)
  Tree:       10 .. 19    (Sort, Collapse)
  Options:    999         (Options)

Sort and Collapse moved from MenuCategory = "View" to "Tree" because
the category identifier should describe the operand -- both act on
the assembly tree, neither is a generic "view" action.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
6d8fff682e
  1. 4
      ILSpy/Commands/BrowseBackCommand.cs
  2. 4
      ILSpy/Commands/ViewCommands.cs

4
ILSpy/Commands/BrowseBackCommand.cs

@ -32,7 +32,7 @@ namespace ILSpy.Commands @@ -32,7 +32,7 @@ namespace ILSpy.Commands
MenuIcon = "Images/Back",
MenuCategory = nameof(Resources.Navigation),
InputGestureText = "Alt+Left",
MenuOrder = 100)]
MenuOrder = 0)]
[Shared]
[method: ImportingConstructor]
sealed class BrowseBackCommand(DockWorkspace dockWorkspace) : ICommand
@ -54,7 +54,7 @@ namespace ILSpy.Commands @@ -54,7 +54,7 @@ namespace ILSpy.Commands
MenuIcon = "Images/Forward",
MenuCategory = nameof(Resources.Navigation),
InputGestureText = "Alt+Right",
MenuOrder = 101)]
MenuOrder = 1)]
[Shared]
[method: ImportingConstructor]
sealed class BrowseForwardCommand(DockWorkspace dockWorkspace) : ICommand

4
ILSpy/Commands/ViewCommands.cs

@ -24,7 +24,7 @@ using ILSpy.AssemblyTree; @@ -24,7 +24,7 @@ using ILSpy.AssemblyTree;
namespace ILSpy.Commands
{
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort", MenuCategory = nameof(Resources.View))]
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort", MenuCategory = "Tree", MenuOrder = 10)]
[ExportToolbarCommand(ToolTip = nameof(Resources.SortAssemblyListName), ToolbarIcon = "Images/Sort", ToolbarCategory = nameof(Resources.View))]
[Shared]
[method: ImportingConstructor]
@ -33,7 +33,7 @@ namespace ILSpy.Commands @@ -33,7 +33,7 @@ namespace ILSpy.Commands
public override void Execute(object? parameter) => assemblyTreeModel.SortAssemblyList();
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll", MenuCategory = nameof(Resources.View))]
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll", MenuCategory = "Tree", MenuOrder = 11)]
[ExportToolbarCommand(ToolTip = nameof(Resources.CollapseTreeNodes), ToolbarIcon = "Images/CollapseAll", ToolbarCategory = nameof(Resources.View))]
[Shared]
[method: ImportingConstructor]

Loading…
Cancel
Save