summaryrefslogtreecommitdiff
path: root/Applications/Browser
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-23 10:57:42 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-23 11:10:52 +0100
commit3d20da9ee451460b6e233f5efdf5a13e11525f97 (patch)
tree524b72d0874304c68036dbbc0514b632a4a08c59 /Applications/Browser
parent7ec758773cdd85755d91f52614f361e7e750c7e9 (diff)
downloadserenity-3d20da9ee451460b6e233f5efdf5a13e11525f97.zip
Userspace: Use Core::Object::add() when building interfaces
Diffstat (limited to 'Applications/Browser')
-rw-r--r--Applications/Browser/InspectorWidget.cpp10
-rw-r--r--Applications/Browser/main.cpp8
2 files changed, 9 insertions, 9 deletions
diff --git a/Applications/Browser/InspectorWidget.cpp b/Applications/Browser/InspectorWidget.cpp
index e9658bae1a..70cd9bc3e9 100644
--- a/Applications/Browser/InspectorWidget.cpp
+++ b/Applications/Browser/InspectorWidget.cpp
@@ -39,8 +39,8 @@ InspectorWidget::InspectorWidget(GUI::Widget* parent)
: GUI::Widget(parent)
{
set_layout(make<GUI::VerticalBoxLayout>());
- auto splitter = GUI::VerticalSplitter::construct(this);
- m_dom_tree_view = GUI::TreeView::construct(splitter);
+ auto splitter = add<GUI::VerticalSplitter>();
+ m_dom_tree_view = splitter->add<GUI::TreeView>();
m_dom_tree_view->on_selection = [this](auto& index) {
auto* node = static_cast<Node*>(index.internal_data());
node->document().set_inspected_node(node);
@@ -55,13 +55,13 @@ InspectorWidget::InspectorWidget(GUI::Widget* parent)
m_computed_style_table_view->set_model(nullptr);
}
};
- m_style_table_view = GUI::TableView::construct(nullptr);
+ m_style_table_view = GUI::TableView::construct();
m_style_table_view->set_size_columns_to_fit_content(true);
- m_computed_style_table_view = GUI::TableView::construct(nullptr);
+ m_computed_style_table_view = GUI::TableView::construct();
m_computed_style_table_view->set_size_columns_to_fit_content(true);
- auto tabwidget = GUI::TabWidget::construct(splitter);
+ auto tabwidget = splitter->add<GUI::TabWidget>();
tabwidget->add_widget("Styles", m_style_table_view);
tabwidget->add_widget("Computed", m_computed_style_table_view);
}
diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp
index 5f34397ba5..d7554eed85 100644
--- a/Applications/Browser/main.cpp
+++ b/Applications/Browser/main.cpp
@@ -80,8 +80,8 @@ int main(int argc, char** argv)
widget->set_layout(make<GUI::VerticalBoxLayout>());
widget->layout()->set_spacing(0);
- auto toolbar = GUI::ToolBar::construct(widget);
- auto html_widget = HtmlView::construct(widget);
+ auto toolbar = widget->add<GUI::ToolBar>();
+ auto html_widget = widget->add<HtmlView>();
History<URL> history;
@@ -121,7 +121,7 @@ int main(int argc, char** argv)
html_widget->reload();
}));
- auto location_box = GUI::TextBox::construct(toolbar);
+ auto location_box = toolbar->add<GUI::TextBox>();
location_box->on_return_pressed = [&] {
html_widget->load(location_box->text());
@@ -151,7 +151,7 @@ int main(int argc, char** argv)
location_box->set_focus(true);
});
- auto statusbar = GUI::StatusBar::construct(widget);
+ auto statusbar = widget->add<GUI::StatusBar>();
html_widget->on_link_hover = [&](auto& href) {
statusbar->set_text(href);