1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57:44 +00:00

WindowServer: Add IPC call to remove a menu's item

This commit is contained in:
Marco Cutecchia 2022-02-14 14:05:42 +01:00 committed by Andreas Kling
parent b6eaefa87d
commit 8ede1a6a6f
5 changed files with 20 additions and 0 deletions

View file

@ -562,6 +562,11 @@ MenuItem* Menu::item_with_identifier(unsigned identifier)
return nullptr;
}
bool Menu::remove_item_with_identifier(unsigned identifier)
{
return m_items.remove_first_matching([&](auto& item) { return item->identifier() == identifier; });
}
int Menu::item_index_at(const Gfx::IntPoint& position)
{
int i = 0;