1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:47:44 +00:00

LibGUI: Use set_layout<LayoutType>() in lots of client code

This commit is contained in:
Andreas Kling 2020-03-04 09:43:54 +01:00
parent 03e0ddce52
commit 4697195645
45 changed files with 109 additions and 109 deletions

View file

@ -52,13 +52,13 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph)
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
set_preferred_size(0, 72);
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 0, 8, 0, 0 });
layout()->set_spacing(3);
auto build_widgets_for_label = [this](const String& description) -> RefPtr<GUI::Label> {
auto container = add<GUI::Widget>();
container->set_layout(make<GUI::HorizontalBoxLayout>());
container->set_layout<GUI::HorizontalBoxLayout>();
container->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
container->set_preferred_size(275, 12);
auto description_label = container->add<GUI::Label>(description);

View file

@ -33,12 +33,12 @@
NetworkStatisticsWidget::NetworkStatisticsWidget()
{
on_first_show = [this](auto&) {
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
set_fill_with_background_color(true);
auto adapters_group_box = add<GUI::GroupBox>("Adapters");
adapters_group_box->set_layout(make<GUI::VerticalBoxLayout>());
adapters_group_box->set_layout<GUI::VerticalBoxLayout>();
adapters_group_box->layout()->set_margins({ 6, 16, 6, 6 });
adapters_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
adapters_group_box->set_preferred_size(0, 120);
@ -58,7 +58,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
m_adapter_table_view->set_model(GUI::JsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields)));
auto sockets_group_box = add<GUI::GroupBox>("Sockets");
sockets_group_box->set_layout(make<GUI::VerticalBoxLayout>());
sockets_group_box->set_layout<GUI::VerticalBoxLayout>();
sockets_group_box->layout()->set_margins({ 6, 16, 6, 6 });
sockets_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
sockets_group_box->set_preferred_size(0, 0);

View file

@ -31,7 +31,7 @@
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget()
{
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = add<GUI::TableView>();
m_table_view->set_size_columns_to_fit_content(true);

View file

@ -66,7 +66,7 @@ public:
ProcessMemoryMapWidget::ProcessMemoryMapWidget()
{
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = add<GUI::TableView>();
m_table_view->set_size_columns_to_fit_content(true);

View file

@ -32,7 +32,7 @@
ProcessStacksWidget::ProcessStacksWidget()
{
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
m_stacks_editor = add<GUI::TextEditor>();
m_stacks_editor->set_readonly(true);

View file

@ -31,7 +31,7 @@
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget()
{
set_layout(make<GUI::VerticalBoxLayout>());
set_layout<GUI::VerticalBoxLayout>();
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = add<GUI::TableView>();
m_table_view->set_size_columns_to_fit_content(true);

View file

@ -117,7 +117,7 @@ int main(int argc, char** argv)
auto keeper = GUI::Widget::construct();
window->set_main_widget(keeper);
keeper->set_layout(make<GUI::VerticalBoxLayout>());
keeper->set_layout<GUI::VerticalBoxLayout>();
keeper->set_fill_with_background_color(true);
keeper->layout()->set_margins({ 4, 4, 4, 4 });
@ -138,7 +138,7 @@ int main(int argc, char** argv)
auto network_stats_widget = NetworkStatisticsWidget::construct();
tabwidget->add_widget("Network", network_stats_widget);
process_table_container->set_layout(make<GUI::VerticalBoxLayout>());
process_table_container->set_layout<GUI::VerticalBoxLayout>();
process_table_container->layout()->set_margins({ 4, 0, 4, 0 });
process_table_container->layout()->set_spacing(0);
@ -273,7 +273,7 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab()
auto fs_widget = GUI::LazyWidget::construct();
fs_widget->on_first_show = [](GUI::LazyWidget& self) {
self.set_layout(make<GUI::VerticalBoxLayout>());
self.set_layout<GUI::VerticalBoxLayout>();
self.layout()->set_margins({ 4, 4, 4, 4 });
auto fs_table_view = self.add<GUI::TableView>();
fs_table_view->set_size_columns_to_fit_content(true);
@ -366,7 +366,7 @@ NonnullRefPtr<GUI::Widget> build_pci_devices_tab()
auto pci_widget = GUI::LazyWidget::construct();
pci_widget->on_first_show = [](GUI::LazyWidget& self) {
self.set_layout(make<GUI::VerticalBoxLayout>());
self.set_layout<GUI::VerticalBoxLayout>();
self.layout()->set_margins({ 4, 4, 4, 4 });
auto pci_table_view = self.add<GUI::TableView>();
pci_table_view->set_size_columns_to_fit_content(true);
@ -424,7 +424,7 @@ NonnullRefPtr<GUI::Widget> build_devices_tab()
auto devices_widget = GUI::LazyWidget::construct();
devices_widget->on_first_show = [](GUI::LazyWidget& self) {
self.set_layout(make<GUI::VerticalBoxLayout>());
self.set_layout<GUI::VerticalBoxLayout>();
self.layout()->set_margins({ 4, 4, 4, 4 });
auto devices_table_view = self.add<GUI::TableView>();
@ -443,11 +443,11 @@ NonnullRefPtr<GUI::Widget> build_graphs_tab()
graphs_container->on_first_show = [](GUI::LazyWidget& self) {
self.set_fill_with_background_color(true);
self.set_background_role(ColorRole::Button);
self.set_layout(make<GUI::VerticalBoxLayout>());
self.set_layout<GUI::VerticalBoxLayout>();
self.layout()->set_margins({ 4, 4, 4, 4 });
auto cpu_graph_group_box = self.add<GUI::GroupBox>("CPU usage");
cpu_graph_group_box->set_layout(make<GUI::VerticalBoxLayout>());
cpu_graph_group_box->set_layout<GUI::VerticalBoxLayout>();
cpu_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
cpu_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
cpu_graph_group_box->set_preferred_size(0, 120);
@ -464,7 +464,7 @@ NonnullRefPtr<GUI::Widget> build_graphs_tab()
};
auto memory_graph_group_box = self.add<GUI::GroupBox>("Memory usage");
memory_graph_group_box->set_layout(make<GUI::VerticalBoxLayout>());
memory_graph_group_box->set_layout<GUI::VerticalBoxLayout>();
memory_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
memory_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
memory_graph_group_box->set_preferred_size(0, 120);