Unindent `MainForm.DisplayDefaultCoreMenu`
This commit is contained in:
parent
15eed689d0
commit
b93eb948fd
|
@ -2141,29 +2141,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
settingsMenuItem.Click += GenericCoreSettingsMenuItem_Click;
|
settingsMenuItem.Click += GenericCoreSettingsMenuItem_Click;
|
||||||
GenericCoreSubMenu.DropDownItems.Add(settingsMenuItem);
|
GenericCoreSubMenu.DropDownItems.Add(settingsMenuItem);
|
||||||
|
|
||||||
var specializedTools = SpecializedTools
|
var specializedTools = SpecializedTools.Where(Tools.IsAvailable).OrderBy(static t => t.Name).ToList();
|
||||||
.Where(t => Tools.IsAvailable(t))
|
if (specializedTools.Count is 0) return;
|
||||||
.OrderBy(t => t.Name)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
if (specializedTools.Any())
|
GenericCoreSubMenu.DropDownItems.Add(new ToolStripSeparator());
|
||||||
|
foreach (var toolType in specializedTools)
|
||||||
{
|
{
|
||||||
GenericCoreSubMenu.DropDownItems.Add(new ToolStripSeparator());
|
ToolStripMenuItem item = new()
|
||||||
foreach (var tool in specializedTools)
|
|
||||||
{
|
{
|
||||||
var dispName = tool.GetCustomAttribute<SpecializedToolAttribute>().DisplayName;
|
Text = $"&{toolType.GetCustomAttribute<SpecializedToolAttribute>().DisplayName}",
|
||||||
var item = new ToolStripMenuItem
|
};
|
||||||
{
|
item.Click += (_, _) => Tools.Load(toolType);
|
||||||
Text = "&" + dispName
|
GenericCoreSubMenu.DropDownItems.Add(item);
|
||||||
};
|
|
||||||
|
|
||||||
item.Click += (o, e) =>
|
|
||||||
{
|
|
||||||
Tools.Load(tool);
|
|
||||||
};
|
|
||||||
|
|
||||||
GenericCoreSubMenu.DropDownItems.Add(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue