mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 21:52:53 +00:00
DisplaySettings: Tweak main window layout & setup code
Get rid of the menu and put some padding around the main tab widget.
This commit is contained in:
parent
83f43b6464
commit
c14ffdef00
Notes:
sideshowbarker
2024-07-18 17:44:40 +09:00
Author: https://github.com/awesomekling
Commit: c14ffdef00
1 changed files with 10 additions and 18 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2019-2020, Jesse Buhagiar <jooster669@gmail.com>
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -33,30 +34,21 @@ int main(int argc, char** argv)
|
|||
|
||||
auto app_icon = GUI::Icon::default_icon("app-display-settings");
|
||||
|
||||
// Let's create the tab pane that we'll hook our widgets up to :^)
|
||||
auto tab_widget = GUI::TabWidget::construct();
|
||||
tab_widget->add_tab<DisplaySettingsWidget>("Display Settings");
|
||||
tab_widget->set_fill_with_background_color(true); // No black backgrounds!
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
dbgln("main window: {}", window);
|
||||
window->set_title("Display Settings");
|
||||
window->resize(360, 410);
|
||||
window->set_resizable(false);
|
||||
window->set_main_widget(tab_widget.ptr());
|
||||
|
||||
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
||||
main_widget.set_fill_with_background_color(true);
|
||||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
main_widget.layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
auto& tab_widget = main_widget.add<GUI::TabWidget>();
|
||||
tab_widget.add_tab<DisplaySettingsWidget>("Display Settings");
|
||||
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
||||
auto menubar = GUI::Menubar::construct();
|
||||
|
||||
auto& file_menu = menubar->add_menu("&File");
|
||||
file_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) {
|
||||
app->quit();
|
||||
}));
|
||||
|
||||
auto& help_menu = menubar->add_menu("&Help");
|
||||
help_menu.add_action(GUI::CommonActions::make_about_action("Display Settings", app_icon, window));
|
||||
|
||||
window->set_menubar(move(menubar));
|
||||
window->show();
|
||||
return app->exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue