diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-10 21:05:20 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-10 21:05:20 +0200 |
commit | 6ef45bc0efd9e51f7f34f91aee5522f81b029b61 (patch) | |
tree | 99a327945c708ac1f82086c8f432fc2f14314222 | |
parent | ba2d0ab19ac5263e60788eef8e90114513960693 (diff) | |
download | serenity-6ef45bc0efd9e51f7f34f91aee5522f81b029b61.zip |
PaintBrush: Add some placeholder menus so it looks proper.
-rw-r--r-- | Applications/PaintBrush/main.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Applications/PaintBrush/main.cpp b/Applications/PaintBrush/main.cpp index 8fc044ea82..dfaa70625b 100644 --- a/Applications/PaintBrush/main.cpp +++ b/Applications/PaintBrush/main.cpp @@ -1,7 +1,10 @@ #include "PaintableWidget.h" #include "PaletteWidget.h" +#include <LibGUI/GAction.h> #include <LibGUI/GApplication.h> #include <LibGUI/GBoxLayout.h> +#include <LibGUI/GMenu.h> +#include <LibGUI/GMenuBar.h> #include <LibGUI/GWindow.h> int main(int argc, char** argv) @@ -17,10 +20,32 @@ int main(int argc, char** argv) main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); main_widget->layout()->set_spacing(0); - auto* paintable_widget = new PaintableWidget(main_widget); auto* palette_widget = new PaletteWidget(*paintable_widget, main_widget); window->show(); + + auto menubar = make<GMenuBar>(); + auto app_menu = make<GMenu>("PaintBrush"); + app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [](const GAction&) { + GApplication::the().quit(0); + return; + })); + menubar->add_menu(move(app_menu)); + + auto file_menu = make<GMenu>("File"); + menubar->add_menu(move(file_menu)); + + auto edit_menu = make<GMenu>("Edit"); + menubar->add_menu(move(edit_menu)); + + auto help_menu = make<GMenu>("Help"); + help_menu->add_action(GAction::create("About", [](const GAction&) { + dbgprintf("FIXME: Implement Help/About\n"); + })); + menubar->add_menu(move(help_menu)); + + app.set_menubar(move(menubar)); + return app.exec(); } |