working on markdown tool tip widget

This commit is contained in:
LarsBrubaker 2020-06-24 18:38:41 -07:00 committed by Lars Brubaker
parent ce5aa1955e
commit 2959b6e411
7 changed files with 72 additions and 40 deletions

View file

@ -329,7 +329,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var operationMenu = popupMenu.CreateMenuItem(operation.Title, operation.Icon?.Invoke(theme.InvertIcons));
operationMenu.ToolTipText = operation.HelpText;
operationMenu.Enabled = operation.IsEnabled(sceneContext);
operationMenu.Enabled = operation.IsEnabled(sceneContext, operationMenu);
operationMenu.Click += (s, e) => UiThread.RunOnIdle(() =>
{
if (operationGroup.StickySelection
@ -663,13 +663,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// Set enabled level based on operation rules
foreach (var (button, operation) in operationButtons.Select(kvp => (kvp.Key, kvp.Value)))
{
button.Enabled = operation.IsEnabled?.Invoke(sceneContext) ?? false;
button.Enabled = operation.IsEnabled?.Invoke(sceneContext, button) ?? false;
if (operation is OperationGroup operationGroup
&& button is PopupMenuButton splitButton
&& button.Descendants<IconButton>().FirstOrDefault() is IconButton iconButton)
{
iconButton.Enabled = operationGroup.GetDefaultOperation().IsEnabled(sceneContext);
iconButton.Enabled = operationGroup.GetDefaultOperation().IsEnabled(sceneContext, iconButton);
}
}
}