mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Userland+LibGUI: Add shorthand versions of the Margins constructor
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
This commit is contained in:
parent
9c9a5c55cb
commit
e11d177618
101 changed files with 232 additions and 201 deletions
|
@ -16,7 +16,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
{
|
||||
on_first_show = [this](auto&) {
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
layout()->set_margins(4);
|
||||
set_fill_with_background_color(true);
|
||||
|
||||
m_network_connected_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/network-connected.png");
|
||||
|
@ -32,7 +32,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
|
||||
auto& adapters_group_box = add<GUI::GroupBox>("Adapters");
|
||||
adapters_group_box.set_layout<GUI::VerticalBoxLayout>();
|
||||
adapters_group_box.layout()->set_margins({ 16, 6, 6, 6 });
|
||||
adapters_group_box.layout()->set_margins({ 16, 6, 6 });
|
||||
adapters_group_box.set_fixed_height(120);
|
||||
|
||||
m_adapter_table_view = adapters_group_box.add<GUI::TableView>();
|
||||
|
@ -69,7 +69,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
|
||||
auto& tcp_sockets_group_box = add<GUI::GroupBox>("TCP Sockets");
|
||||
tcp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>();
|
||||
tcp_sockets_group_box.layout()->set_margins({ 16, 6, 6, 6 });
|
||||
tcp_sockets_group_box.layout()->set_margins({ 16, 6, 6 });
|
||||
|
||||
m_tcp_socket_table_view = tcp_sockets_group_box.add<GUI::TableView>();
|
||||
|
||||
|
@ -90,7 +90,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
|||
|
||||
auto& udp_sockets_group_box = add<GUI::GroupBox>("UDP Sockets");
|
||||
udp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>();
|
||||
udp_sockets_group_box.layout()->set_margins({ 16, 6, 6, 6 });
|
||||
udp_sockets_group_box.layout()->set_margins({ 16, 6, 6 });
|
||||
|
||||
m_udp_socket_table_view = udp_sockets_group_box.add<GUI::TableView>();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue