summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecklynKern <DecklynKern@gmail.com>2023-10-06 17:33:38 -0600
committerDecklynKern <DecklynKern@gmail.com>2023-10-06 17:33:38 -0600
commitb2bf8ef504f29650f8fe0adab41c3cac35b67567 (patch)
treec2ce6198af35a471be0e8e4b204e64c9a6693305
parent636eb25f5e31a7af337b024873b2ceb42650ebdb (diff)
Fix scrollbar not clearing sometimes.
-rw-r--r--src/btop_draw.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp
index c471c52..b7ddc74 100644
--- a/src/btop_draw.cpp
+++ b/src/btop_draw.cpp
@@ -1556,8 +1556,11 @@ namespace Proc {
if (numpids > select_max) {
const int scroll_pos = clamp((int)round((double)start * select_max / (numpids - select_max)), 0, height - 5);
out += Mv::to(y + 1, x + width - 2) + Fx::b + Theme::c("main_fg") + Symbols::up
- + Mv::to(y + height - 2, x + width - 2) + Symbols::down
- + Mv::to(y + 2 + scroll_pos, x + width - 2) + "█";
+ + Mv::to(y + height - 2, x + width - 2) + Symbols::down;
+
+ for (int i = y + 2; i < y + height - 2; i++) {
+ out += Mv::to(i, x + width - 2) + ((i == y + 2 + scroll_pos) ? "█" : " ");
+ }
}
//? Current selection and number of processes