WindowServer: Add const qualified version of MenuItem::submenu()

This commit is contained in:
Shannon Booth 2020-05-18 22:06:46 +12:00 committed by Andreas Kling
parent f06c12173c
commit 08064ed219
Notes: sideshowbarker 2024-07-19 06:31:27 +09:00
2 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,13 @@ Menu* MenuItem::submenu()
return m_menu.client()->find_menu_by_id(m_submenu_id);
}
const Menu* MenuItem::submenu() const
{
ASSERT(is_submenu());
ASSERT(m_menu.client());
return m_menu.client()->find_menu_by_id(m_submenu_id);
}
Gfx::Rect MenuItem::rect() const
{
if (!m_menu.is_scrollable())

View File

@ -77,6 +77,7 @@ public:
void set_submenu_id(int submenu_id) { m_submenu_id = submenu_id; }
Menu* submenu();
const Menu* submenu() const;
bool is_exclusive() const { return m_exclusive; }
void set_exclusive(bool exclusive) { m_exclusive = exclusive; }