mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
FileManager: Add some menus.
This commit is contained in:
parent
28da956a12
commit
f33f094483
Notes:
sideshowbarker
2024-07-19 15:45:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f33f094483a
@ -3,6 +3,8 @@
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GStatusBar.h>
|
||||
#include <LibGUI/GMenuBar.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include "DirectoryView.h"
|
||||
@ -13,6 +15,26 @@ int main(int argc, char** argv)
|
||||
{
|
||||
GApplication app(argc, argv);
|
||||
|
||||
auto menubar = make<GMenuBar>();
|
||||
|
||||
auto app_menu = make<GMenu>("FileManager");
|
||||
app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) {
|
||||
GApplication::the().exit(0);
|
||||
return;
|
||||
}));
|
||||
menubar->add_menu(move(app_menu));
|
||||
|
||||
auto file_menu = make<GMenu>("File");
|
||||
menubar->add_menu(move(file_menu));
|
||||
|
||||
auto help_menu = make<GMenu>("Help");
|
||||
help_menu->add_action(make<GAction>("About", [] (const GAction&) {
|
||||
dbgprintf("FIXME: Implement Help/About\n");
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
app.set_menubar(move(menubar));
|
||||
|
||||
auto* window = make_window();
|
||||
window->set_should_exit_app_on_close(true);
|
||||
window->show();
|
||||
|
Loading…
Reference in New Issue
Block a user