Skip to content

Commit

Permalink
WindowServer: Add const qualified version of MenuItem::submenu()
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonbooth authored and awesomekling committed May 18, 2020
1 parent f06c121 commit 08064ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Services/WindowServer/MenuItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions Services/WindowServer/MenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class MenuItem {
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; }
Expand Down

0 comments on commit 08064ed

Please sign in to comment.