diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-14 16:38:28 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-14 19:55:17 +0200 |
commit | 856f683dc99e8bb0e42276c59598ff633ca0995e (patch) | |
tree | 1a52fc518bcbe4a186b8e31477cbd639a5fe4644 /Applications/Browser/main.cpp | |
parent | 3355a3e179cd2fdb7348eaee6dd23b6df8483601 (diff) | |
download | serenity-856f683dc99e8bb0e42276c59598ff633ca0995e.zip |
Browser: Generate the main browser window UI from JSON :^)
Diffstat (limited to 'Applications/Browser/main.cpp')
-rw-r--r-- | Applications/Browser/main.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index 8c6191f8fa..b3b19a90bc 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -30,6 +30,7 @@ #include "Tab.h" #include "WindowActions.h" #include <AK/StringBuilder.h> +#include <Applications/Browser/BrowserWindowUI.h> #include <LibCore/ArgsParser.h> #include <LibCore/ConfigFile.h> #include <LibCore/File.h> @@ -134,14 +135,10 @@ int main(int argc, char** argv) window->set_title("Browser"); auto& widget = window->set_main_widget<GUI::Widget>(); - widget.set_fill_with_background_color(true); - widget.set_layout<GUI::VerticalBoxLayout>(); - widget.layout()->set_spacing(2); + widget.load_from_json(browser_window_ui_json); - auto& tab_widget = widget.add<GUI::TabWidget>(); + auto& tab_widget = static_cast<GUI::TabWidget&>(*widget.find_descendant_by_name("tab_widget")); tab_widget.set_text_alignment(Gfx::TextAlignment::CenterLeft); - tab_widget.set_container_padding(0); - tab_widget.set_uniform_tabs(true); auto default_favicon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"); ASSERT(default_favicon); |