commit 8e250b1f744d40b99badf2144a9ef264448bedf8
parent 666a9b23cc8f90f925f8f559e4eae338ed7467a6
Author: lostd <lostd@2f30.org>
Date: Sat, 11 Jun 2016 10:39:12 +0100
Draw individual elements on current line
We can now easily change the order in which they appear.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/ncmixer.c b/ncmixer.c
@@ -303,17 +303,17 @@ draw_status(void)
offs = ISODD(COLS) ? 2 : 3;
if (COLS < 2 + strlen("[CH0: ] [MON: ] [CH1: ] [MON: ]") + offs) {
- move(0, 0);
+ move(getcury(stdscr), 0);
printw("\n");
return;
}
- move(0, 2);
+ move(getcury(stdscr), 2);
clrtoeol();
printw("[CH0:%c] [MON:%c]",
inputs[0].clifd != -1 ? '*' : ' ',
inputs[0].monitor != 0 ? '*' : ' ');
- move(0, COLS - strlen("[MON: ] [CH1: ]") - offs);
+ move(getcury(stdscr), COLS - strlen("[MON: ] [CH1: ]") - offs);
printw("[CH1:%c] [MON:%c]",
inputs[1].clifd != -1 ? '*' : ' ',
inputs[1].monitor != 0 ? '*' : ' ');
@@ -356,11 +356,14 @@ draw_xfader(void)
printw("|x|");
else
printw("|||");
+ move(getcury(stdscr), end);
+ printw("\n");
}
void
draw(void)
{
+ move(0, 0);
draw_status();
draw_xfader();
refresh();