From d6cd850dbb45aaeea11399515e0cbcb8d07bbb50 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 27 Jun 2024 23:38:10 -0400 Subject: [PATCH] [Meter] Remove Bar borders This is an experiment in Tufte-ism --- Meter.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Meter.c b/Meter.c index 3899f35c..2a35b636 100644 --- a/Meter.c +++ b/Meter.c @@ -76,18 +76,11 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) { attrset(CRT_colors[METER_TEXT]); int captionLen = 3; mvaddnstr(y, x, caption, captionLen); - x += captionLen; - w -= captionLen; - - // Draw the bar borders - attrset(CRT_colors[BAR_BORDER]); - mvaddch(y, x, '['); - w--; - mvaddch(y, x + MAXIMUM(w, 0), ']'); - w--; + x += captionLen+1; + w -= captionLen+1; attrset(CRT_colors[RESET_COLOR]); - x++; + if (caption[0] == 0) { if (w < 1) { return;