mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 10:18:51 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue