mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>(). Work towards #20557.
This commit is contained in:
parent
341626e2ea
commit
8322b31b97
52 changed files with 127 additions and 135 deletions
|
@ -18,7 +18,7 @@ namespace SystemMonitor {
|
|||
ErrorOr<NonnullRefPtr<ProcessFileDescriptorMapWidget>> ProcessFileDescriptorMapWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessFileDescriptorMapWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields;
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
ErrorOr<NonnullRefPtr<ProcessMemoryMapWidget>> ProcessMemoryMapWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessMemoryMapWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_vm_fields;
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
ErrorOr<NonnullRefPtr<ProcessStateWidget>> ProcessStateWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessStateWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
widget->m_table_view->set_model(TRY(try_make_ref_counted<ProcessStateModel>(ProcessModel::the(), 0)));
|
||||
widget->m_table_view->column_header().set_visible(false);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace SystemMonitor {
|
|||
ErrorOr<NonnullRefPtr<ProcessUnveiledPathsWidget>> ProcessUnveiledPathsWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessUnveiledPathsWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields;
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
ErrorOr<NonnullRefPtr<ThreadStackWidget>> ThreadStackWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ThreadStackWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_stack_table = TRY(widget->try_add<GUI::TableView>());
|
||||
widget->m_stack_table->set_model(TRY(try_make_ref_counted<ThreadStackModel>()));
|
||||
return widget;
|
||||
|
|
|
@ -578,7 +578,7 @@ ErrorOr<void> build_performance_tab(GUI::Widget& graphs_container)
|
|||
Vector<SystemMonitor::GraphWidget&> cpu_graphs;
|
||||
for (auto row = 0u; row < cpu_graph_rows; ++row) {
|
||||
auto cpu_graph_row = TRY(cpu_graph_group_box.try_add<GUI::Widget>());
|
||||
TRY(cpu_graph_row->try_set_layout<GUI::HorizontalBoxLayout>(6));
|
||||
cpu_graph_row->set_layout<GUI::HorizontalBoxLayout>(6);
|
||||
cpu_graph_row->set_fixed_height(108);
|
||||
for (auto i = 0u; i < cpu_graphs_per_row; ++i) {
|
||||
auto cpu_graph = TRY(cpu_graph_row->try_add<SystemMonitor::GraphWidget>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue