mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibGUI: Remove Menubar::try_add_menu()
And fall back to the infallible add_menu().
This commit is contained in:
parent
94cd272ac0
commit
5300896095
4 changed files with 8 additions and 17 deletions
|
@ -10,20 +10,12 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
ErrorOr<void> Menubar::try_add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
|
||||
void Menubar::add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
|
||||
{
|
||||
TRY(m_menus.try_append(menu));
|
||||
return {};
|
||||
m_menus.append(menu);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, String name)
|
||||
{
|
||||
auto menu = TRY(try_add<Menu>(move(name)));
|
||||
TRY(m_menus.try_append(menu));
|
||||
return menu;
|
||||
}
|
||||
|
||||
Menu& Menubar::add_menu(Badge<Window>, String name)
|
||||
NonnullRefPtr<Menu> Menubar::add_menu(Badge<Window>, String name)
|
||||
{
|
||||
auto& menu = add<Menu>(move(name));
|
||||
m_menus.append(menu);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue