mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
LibCore: Make Core::Object::add<ChildType> return a ChildType&
Since the returned object is now owned by the callee object, we can simply vend a ChildType&. This allows us to use "." instead of "->" at the call site, which is quite nice. :^)
This commit is contained in:
parent
fb09b6a8ce
commit
028c011760
46 changed files with 1035 additions and 1039 deletions
|
@ -38,8 +38,8 @@
|
|||
InspectorWidget::InspectorWidget()
|
||||
{
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
auto splitter = add<GUI::VerticalSplitter>();
|
||||
m_dom_tree_view = splitter->add<GUI::TreeView>();
|
||||
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,12 +55,12 @@ InspectorWidget::InspectorWidget()
|
|||
}
|
||||
};
|
||||
|
||||
auto tab_widget = splitter->add<GUI::TabWidget>();
|
||||
auto& tab_widget = splitter.add<GUI::TabWidget>();
|
||||
|
||||
m_style_table_view = tab_widget->add_tab<GUI::TableView>("Styles");
|
||||
m_style_table_view = tab_widget.add_tab<GUI::TableView>("Styles");
|
||||
m_style_table_view->set_size_columns_to_fit_content(true);
|
||||
|
||||
m_computed_style_table_view = tab_widget->add_tab<GUI::TableView>("Computed");
|
||||
m_computed_style_table_view = tab_widget.add_tab<GUI::TableView>("Computed");
|
||||
m_computed_style_table_view->set_size_columns_to_fit_content(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue