Menu overflow should show both enabled and disabled menu items

- MatterHackers/MCCentral#2931
This commit is contained in:
John Lewin 2018-03-14 13:17:16 -07:00
parent 634d5223d5
commit 963643c860
2 changed files with 6 additions and 2 deletions

View file

@ -115,8 +115,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
var popupMenu = new PopupMenu(theme);
// Perform overflow
bool hasOverflowItems = false;
foreach (var widget in overflowBar.ActionArea.Children.Where(c => c.Enabled && !c.Visible && !ignoredInMenuTypes.Contains(c.GetType())))
foreach (var widget in overflowBar.ActionArea.Children.Where(c => !c.Visible && !ignoredInMenuTypes.Contains(c.GetType())))
{
hasOverflowItems = true;
@ -128,6 +129,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
widget.ToolTipText ?? widget.Text,
iconButton?.IconImage);
menuItem.Enabled = widget.Enabled;
menuItem.Click += (s, e) =>
{
widget.OnClick(e);
@ -139,6 +142,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
popupMenu.CreateHorizontalLine();
}
// Extend menu with non-overflow/standard items
overflowBar.OnExtendPopupMenu(popupMenu);
return popupMenu;