Skip to content

Commit

Permalink
Fixed missing CPU core temps when too small to show core temp graphs,…
Browse files Browse the repository at this point in the history
… issues #792 #867
  • Loading branch information
aristocratos committed Jun 1, 2024
1 parent 97d2fb5 commit 3f384c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/btop_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@ namespace Cpu {
out += Theme::g("cpu").at(clamp(safeVal(cpu.core_percent, n).back(), 0ll, 100ll));
out += rjust(to_string(safeVal(cpu.core_percent, n).back()), (b_column_size < 2 ? 3 : 4)) + Theme::c("main_fg") + '%';

if (show_temps and not hide_cores and std::cmp_greater_equal(temp_graphs.size(), n)) {
if (show_temps and not hide_cores) {
const auto [temp, unit] = celsius_to(safeVal(cpu.temp, n+1).back(), temp_scale);
const auto& temp_color = Theme::g("temp").at(clamp(safeVal(cpu.temp, n+1).back() * 100 / cpu.temp_max, 0ll, 100ll));
if (b_column_size > 1)
if (b_column_size > 1 and std::cmp_greater_equal(temp_graphs.size(), n))
out += ' ' + Theme::c("inactive_fg") + graph_bg * 5 + Mv::l(5)
+ temp_graphs.at(n+1)(safeVal(cpu.temp, n+1), data_same or redraw);
out += temp_color + rjust(to_string(temp), 4) + Theme::c("main_fg") + unit;
Expand Down

0 comments on commit 3f384c0

Please sign in to comment.