diff options
author | Jami Kettunen <jami.kettunen@protonmail.com> | 2019-12-31 00:12:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-31 01:46:42 +0100 |
commit | 74a18c86c987fd11b085e3e802755ff74ac9f15b (patch) | |
tree | 14591ee57983ebe9e34c78f0f63e251821632f34 /Applications/ChanViewer | |
parent | 33b8d37dd3a4f6dd2a5f3d3c2d96b7441ba0a488 (diff) | |
download | serenity-74a18c86c987fd11b085e3e802755ff74ac9f15b.zip |
Applications: Implement some missing MenuBars & AboutDialogs
Diffstat (limited to 'Applications/ChanViewer')
-rw-r--r-- | Applications/ChanViewer/main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Applications/ChanViewer/main.cpp b/Applications/ChanViewer/main.cpp index e84fd06368..7b977fdddf 100644 --- a/Applications/ChanViewer/main.cpp +++ b/Applications/ChanViewer/main.cpp @@ -1,9 +1,12 @@ #include "BoardListModel.h" #include "ThreadCatalogModel.h" #include <LibDraw/PNGLoader.h> +#include <LibGUI/GAboutDialog.h> +#include <LibGUI/GAction.h> #include <LibGUI/GApplication.h> #include <LibGUI/GBoxLayout.h> #include <LibGUI/GComboBox.h> +#include <LibGUI/GMenuBar.h> #include <LibGUI/GStatusBar.h> #include <LibGUI/GTableView.h> #include <LibGUI/GWindow.h> @@ -53,5 +56,22 @@ int main(int argc, char** argv) window->show(); + auto menubar = make<GMenuBar>(); + + auto app_menu = GMenu::construct("ChanViewer"); + app_menu->add_action(GCommonActions::make_quit_action([](auto&) { + GApplication::the().quit(0); + return; + })); + menubar->add_menu(move(app_menu)); + + auto help_menu = GMenu::construct("Help"); + help_menu->add_action(GAction::create("About", [&](const GAction&) { + GAboutDialog::show("ChanViewer", load_png("/res/icons/32x32/app-chanviewer.png"), window); + })); + menubar->add_menu(move(help_menu)); + + app.set_menubar(move(menubar)); + return app.exec(); } |