mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
ThemeEditor: Add menu bar with quit and about items
This commit is contained in:
parent
704e1c2e3d
commit
12f0602379
1 changed files with 11 additions and 0 deletions
|
@ -10,6 +10,8 @@
|
||||||
#include <LibGUI/ColorInput.h>
|
#include <LibGUI/ColorInput.h>
|
||||||
#include <LibGUI/ComboBox.h>
|
#include <LibGUI/ComboBox.h>
|
||||||
#include <LibGUI/Icon.h>
|
#include <LibGUI/Icon.h>
|
||||||
|
#include <LibGUI/Menu.h>
|
||||||
|
#include <LibGUI/Menubar.h>
|
||||||
#include <LibGUI/Model.h>
|
#include <LibGUI/Model.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -74,6 +76,14 @@ int main(int argc, char** argv)
|
||||||
Gfx::Palette preview_palette = app->palette();
|
Gfx::Palette preview_palette = app->palette();
|
||||||
|
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
|
auto menubar = GUI::Menubar::construct();
|
||||||
|
|
||||||
|
auto& file_menu = menubar->add_menu("&File");
|
||||||
|
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
|
||||||
|
|
||||||
|
auto& help_menu = menubar->add_menu("&Help");
|
||||||
|
help_menu.add_action(GUI::CommonActions::make_about_action("Theme Editor", app_icon, window));
|
||||||
|
|
||||||
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
||||||
main_widget.set_fill_with_background_color(true);
|
main_widget.set_fill_with_background_color(true);
|
||||||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||||
|
@ -109,6 +119,7 @@ int main(int argc, char** argv)
|
||||||
};
|
};
|
||||||
|
|
||||||
window->resize(480, 500);
|
window->resize(480, 500);
|
||||||
|
window->set_menubar(menubar);
|
||||||
window->show();
|
window->show();
|
||||||
window->set_title("Theme Editor");
|
window->set_title("Theme Editor");
|
||||||
window->set_icon(app_icon.bitmap_for_size(16));
|
window->set_icon(app_icon.bitmap_for_size(16));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue