mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
SystemMonitor: Don't display empty CPU graphs when number of CPUs < 4
When we have less than 4 CPUs we don't need to display a whole row of CPU graphs.
This commit is contained in:
parent
a5b11f7484
commit
8b39ec7c18
1 changed files with 1 additions and 1 deletions
|
@ -670,7 +670,7 @@ NonnullRefPtr<GUI::Widget> build_performance_tab()
|
|||
auto& cpu_graph_group_box = graphs_container->add<GUI::GroupBox>("CPU usage");
|
||||
cpu_graph_group_box.set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
static constexpr size_t cpu_graphs_per_row = 4;
|
||||
size_t cpu_graphs_per_row = min(4, ProcessModel::the().cpus().size());
|
||||
auto cpu_graph_rows = ceil_div(ProcessModel::the().cpus().size(), cpu_graphs_per_row);
|
||||
cpu_graph_group_box.set_fixed_height(120u * cpu_graph_rows);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue