Add automatic last dangling separator removal in context menu
This commit is contained in:
@@ -363,8 +363,8 @@ namespace FlaxEditor.GUI.ContextMenu
|
|||||||
public override void Show(Control parent, Float2 location)
|
public override void Show(Control parent, Float2 location)
|
||||||
{
|
{
|
||||||
// Remove last separator to make context menu look better
|
// Remove last separator to make context menu look better
|
||||||
int lastIndex = Children.Count - 1;
|
int lastIndex = _panel.Children.Count - 1;
|
||||||
if (lastIndex >= 0 && Children[lastIndex] is ContextMenuSeparator separator)
|
if (lastIndex >= 0 && _panel.Children[lastIndex] is ContextMenuSeparator separator)
|
||||||
separator.Dispose();
|
separator.Dispose();
|
||||||
|
|
||||||
base.Show(parent, location);
|
base.Show(parent, location);
|
||||||
|
|||||||
Reference in New Issue
Block a user