1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibGUI: Allow adding previously constructed menus to Menubar

This commit is contained in:
thankyouverycool 2022-09-26 08:42:36 -04:00 committed by Andreas Kling
parent 9cf93528f5
commit c88d77361c
4 changed files with 18 additions and 0 deletions

View file

@ -10,6 +10,12 @@
namespace GUI {
ErrorOr<void> Menubar::try_add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
{
TRY(m_menus.try_append(menu));
return {};
}
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, String name)
{
auto menu = TRY(try_add<Menu>(move(name)));