commit 434e262167738e6e524f8ad8feabef519e31e5e1
parent 83b6adab3a4bb63687c5f192bdf64cee1c1cd44b
Author: lostd <lostd@2f30.org>
Date: Sat, 11 Jun 2016 08:59:46 +0100
Hide status line if it doesn't fit in whole
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ncmixer.c b/ncmixer.c
@@ -301,12 +301,18 @@ draw_status(void)
{
int offs;
+ offs = ISODD(COLS) ? 2 : 3;
+ if (COLS < 2 + strlen("[CH0: ] [MON: ] [MON: ] [CH1: ]") + offs) {
+ move(0, 0);
+ printw("\n");
+ return;
+ }
+
move(0, 2);
clrtoeol();
printw("[CH0:%c] [MON:%c]",
inputs[0].clifd != -1 ? '*' : ' ',
inputs[0].monitor != 0 ? '*' : ' ');
- offs = ISODD(COLS) ? 2 : 3;
move(0, COLS - strlen("[MON: ] [CH1: ]") - offs);
printw("[MON:%c] [CH1:%c]",
inputs[1].monitor != 0 ? '*' : ' ',