Skip to content

Commit

Permalink
#4791: PopupMenu hides separators at the bottom of the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 30, 2021
1 parent d82c943 commit dd4b98b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/wxutil/menu/PopupMenu.cpp
Expand Up @@ -112,6 +112,17 @@ void PopupMenu::show(wxWindow* parent)
item->getMenuItem()->Enable(item->isSensitive());
}

// Detach any separator that might end up at the bottom of the menu
if (GetMenuItemCount() > 0)
{
auto lastItem = FindItemByPosition(GetMenuItemCount() - 1);

if (lastItem && lastItem->IsSeparator())
{
Remove(lastItem);
}
}

parent->PopupMenu(this);
}

Expand Down

0 comments on commit dd4b98b

Please sign in to comment.