diff options
author | James Booth <boothj5@gmail.com> | 2012-02-12 23:48:00 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-02-12 23:48:00 +0000 |
commit | c5d68a64346e0cbbe9def4697b7998a9215cb0c6 (patch) | |
tree | 3a51f6585d347dd16107b6e10c59de3f4a1f6d55 | |
parent | fc99e686fd46f20def60485d60a1aedd3a0710bc (diff) | |
download | profani-tty-c5d68a64346e0cbbe9def4697b7998a9215cb0c6.tar.gz |
Better output of action window notifications
-rw-r--r-- | status_bar.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/status_bar.c b/status_bar.c index cbc0d810..b9ef76a3 100644 --- a/status_bar.c +++ b/status_bar.c @@ -3,6 +3,7 @@ #include "util.h" static WINDOW *status_bar; +static char _active[29] = "[ ][ ][ ][ ][ ][ ][ ][ ][ ]"; static void _status_bar_update_time(void); @@ -26,14 +27,27 @@ void status_bar_refresh(void) void status_bar_inactive(int win) { - mvwaddch(status_bar, 0, 30 + win, ' '); + _active[1 + ((win - 1) * 3)] = ' '; if (win == 9) - mvwaddch(status_bar, 0, 30 + win + 1, ' '); + _active[1 + ((win -1) * 3)] = ' '; + + int rows, cols; + getmaxyx(stdscr, rows, cols); + mvwprintw(status_bar, 0, cols - 29, _active); } void status_bar_active(int win) { - mvwprintw(status_bar, 0, 30 + win, "%d", win+1); + if (win < 9) { + _active[1 + ((win -1) * 3)] = (char)( ((int)'0') + (win + 1)); + } else { + _active[25] = '1'; + _active[26] = '0'; + } + + int rows, cols; + getmaxyx(stdscr, rows, cols); + mvwprintw(status_bar, 0, cols - 29, _active); } void status_bar_get_password(void) |