diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 3603406..780c6c1 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -637,7 +637,7 @@ namespace Cpu { if (b_column_size > 0 or extra_width > 0) out += Theme::c("inactive_fg") + graph_bg * (5 * b_column_size + extra_width) + Mv::l(5 * b_column_size + extra_width) + core_graphs.at(n)(cpu.core_percent.at(n), data_same or redraw); - + out += Theme::g("cpu").at(clamp(cpu.core_percent.at(n).back(), 0ll, 100ll)); out += rjust(to_string(cpu.core_percent.at(n).back()), (b_column_size < 2 ? 3 : 4)) + Theme::c("main_fg") + '%'; @@ -824,10 +824,11 @@ namespace Mem { if (title.empty()) title = capitalize(name); const string humanized = floating_humanizer(mem.stats.at(name)); + const int offset = max(0, divider.empty() ? 9 - (int)humanized.size() : 0); const string graphics = (use_graphs ? mem_graphs.at(name)(mem.percent.at(name), redraw or data_same) : mem_meters.at(name)(mem.percent.at(name).back())); if (mem_size > 2) { out += Mv::to(y+1+cy, x+1+cx) + divider + title.substr(0, big_mem ? 10 : 5) + ":" - + Mv::to(y+1+cy, x+cx + mem_width - 2 - humanized.size()) + trans(humanized) + + Mv::to(y+1+cy, x+cx + mem_width - 2 - humanized.size()) + (divider.empty() ? Mv::l(offset) + string(" ") * offset + humanized : trans(humanized)) + Mv::to(y+2+cy, x+cx + (graph_height >= 2 ? 0 : 1)) + graphics + up + rjust(to_string(mem.percent.at(name).back()) + "%", 4); cy += (graph_height == 0 ? 2 : graph_height + 1); }