mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
LibGUI: Simplify submenu construction
The API for adding a submenu to a menu is now: auto& submenu = menu.add_submenu("Name"); submenu.add_action(my_action);
This commit is contained in:
parent
13dcd9a037
commit
f0cde70c18
Notes:
sideshowbarker
2024-07-19 07:11:54 +09:00
Author: https://github.com/awesomekling
Commit: f0cde70c18
9 changed files with 57 additions and 65 deletions
|
@ -37,7 +37,7 @@ MenuItem::MenuItem(unsigned menu_id, Type type)
|
|||
{
|
||||
}
|
||||
|
||||
MenuItem::MenuItem(unsigned menu_id, NonnullRefPtr<Action>&& action)
|
||||
MenuItem::MenuItem(unsigned menu_id, NonnullRefPtr<Action> action)
|
||||
: m_type(Type::Action)
|
||||
, m_menu_id(menu_id)
|
||||
, m_action(move(action))
|
||||
|
@ -49,7 +49,7 @@ MenuItem::MenuItem(unsigned menu_id, NonnullRefPtr<Action>&& action)
|
|||
m_checked = m_action->is_checked();
|
||||
}
|
||||
|
||||
MenuItem::MenuItem(unsigned menu_id, NonnullRefPtr<Menu>&& submenu)
|
||||
MenuItem::MenuItem(unsigned menu_id, NonnullRefPtr<Menu> submenu)
|
||||
: m_type(Type::Submenu)
|
||||
, m_menu_id(menu_id)
|
||||
, m_submenu(move(submenu))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue