diff options
author | romner <roman@skotnica.com> | 2023-07-16 17:19:09 +0200 |
---|---|---|
committer | romner <roman@skotnica.com> | 2023-07-16 17:19:09 +0200 |
commit | 46c6be0a296e922a265f1ad6ec0cfdcb487783d7 (patch) | |
tree | 29ab8ccb83819afce826b0e04d39ebe5a2b7619d | |
parent | 85fb28cee6e6953ce5aed4725ce82bf65a7e5ade (diff) |
Fix GPU horizontal text overflow in CPU panel
-rw-r--r-- | src/btop_draw.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index b049f1c..c2c44f3 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -842,9 +842,11 @@ namespace Cpu { } else out += Mv::r(17); if (show_temps and gpus[i].supported_functions.temp_info) { const auto [temp, unit] = celsius_to(gpus[i].temp.back(), temp_scale); - out += ' ' + Theme::c("inactive_fg") + graph_bg * 6 + Mv::l(6) + Theme::g("temp").at(clamp(gpus[i].temp.back() * 100 / gpus[i].temp_max, 0ll, 100ll)) - + gpu_temp_graphs[i](gpus[i].temp, data_same or redraw) - + rjust(to_string(temp), 4) + Theme::c("main_fg") + unit; + if (b_width > 38) + out += ' ' + Theme::c("inactive_fg") + graph_bg * 6 + Mv::l(6) + Theme::g("temp").at(clamp(gpus[i].temp.back() * 100 / gpus[i].temp_max, 0ll, 100ll)) + + gpu_temp_graphs[i](gpus[i].temp, data_same or redraw); + else out += Theme::g("temp").at(clamp(gpus[i].temp.back() * 100 / gpus[i].temp_max, 0ll, 100ll)); + out += rjust(to_string(temp), 4) + Theme::c("main_fg") + unit; } } } |