diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-29 11:48:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-29 11:48:11 +0200 |
commit | f0cde70c18b51f8e2a701a0cbf0df028e7231e12 (patch) | |
tree | ae28a6a81a3e1edc692f5d5a5fdb22d2f6e9bce3 /Applications/SystemMenu | |
parent | 13dcd9a0379c09e0c88f6a814b58e4a76e34c0ee (diff) | |
download | serenity-f0cde70c18b51f8e2a701a0cbf0df028e7231e12.zip |
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);
Diffstat (limited to 'Applications/SystemMenu')
-rw-r--r-- | Applications/SystemMenu/main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Applications/SystemMenu/main.cpp b/Applications/SystemMenu/main.cpp index 4398acb82d..1a12b9548b 100644 --- a/Applications/SystemMenu/main.cpp +++ b/Applications/SystemMenu/main.cpp @@ -137,9 +137,8 @@ NonnullRefPtr<GUI::Menu> build_system_menu() if (g_app_category_menus.contains(category)) continue; - auto category_menu = GUI::Menu::construct(category); - system_menu->add_submenu(category_menu); - g_app_category_menus.set(category, move(category_menu)); + auto& category_menu = system_menu->add_submenu(category); + g_app_category_menus.set(category, category_menu); } // Then we create and insert all the app menu items into the right place. @@ -171,9 +170,8 @@ NonnullRefPtr<GUI::Menu> build_system_menu() g_themes_group.set_exclusive(true); g_themes_group.set_unchecking_allowed(false); - g_themes_menu = GUI::Menu::construct("Themes"); - system_menu->add_submenu(*g_themes_menu); + g_themes_menu = &system_menu->add_submenu("Themes"); { Core::DirIterator dt("/res/themes", Core::DirIterator::SkipDots); |