diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-21 21:21:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-21 21:24:26 +0200 |
commit | 687a12d7fb480cf3586c97e30cdb4f67d7e72da5 (patch) | |
tree | 18075eda4d084c161e935c4d386f6b9f6790a9d1 /Userland/DevTools/HackStudio/main.cpp | |
parent | a4fdb7f0296379affbf1083a7875d40e1624a067 (diff) | |
download | serenity-687a12d7fb480cf3586c97e30cdb4f67d7e72da5.zip |
Userland: Add GUI::Window::add_menu() and use it everywhere
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().
This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
Diffstat (limited to 'Userland/DevTools/HackStudio/main.cpp')
-rw-r--r-- | Userland/DevTools/HackStudio/main.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp index e851d00cb5..08fa39017d 100644 --- a/Userland/DevTools/HackStudio/main.cpp +++ b/Userland/DevTools/HackStudio/main.cpp @@ -66,9 +66,7 @@ int main(int argc, char** argv) s_window->set_title(String::formatted("{} - Hack Studio", s_hack_studio_widget->project().name())); - auto menubar = GUI::Menubar::construct(); - s_hack_studio_widget->initialize_menubar(menubar); - s_window->set_menubar(menubar); + s_hack_studio_widget->initialize_menubar(*s_window); s_window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision { s_hack_studio_widget->locator().close(); |