Add automatic last dangling separator removal in context menu
This commit is contained in:
@@ -359,6 +359,17 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
ButtonClicked?.Invoke(button);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Show(Control parent, Float2 location)
|
||||
{
|
||||
// Remove last separator to make context menu look better
|
||||
int lastIndex = Children.Count - 1;
|
||||
if (lastIndex >= 0 && Children[lastIndex] is ContextMenuSeparator separator)
|
||||
separator.Dispose();
|
||||
|
||||
base.Show(parent, location);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool ContainsPoint(ref Float2 location, bool precise)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user